python - Decoding a base64 encryption on other device -


i using python build in library encode md5 digest using base 64. library using :

      hashlib import md5 

my code encode "email" variable:

     apitoken = md5(email).digest().encode('base64')[:-1] 

now problem "apitoken" being sent other device need decode base64 email md5.

what key should send them? salt value?

if requirement send encrypted data should not use one-way hashing algorithm md5 (which weak algorithm, in case). recommend using known symmetric/asymmetric algorithms aes python cryptography toolkit (pycrypto)

the encrypted data can unencrypted @ client end using appropriate client library algorithm. recommend reading book on security such bruce schneier's "applied cryptography" understand how build secure system.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -