Python implementation of RNCryptor
$ pip install rncryptorimportrncryptordata='...'password='...'# rncryptor.RNCryptor's methodscryptor=rncryptor.RNCryptor()
encrypted_data=cryptor.encrypt(data, password)
decrypted_data=cryptor.decrypt(encrypted_data, password)
assertdata==decrypted_data# rncryptor's functionsencrypted_data=rncryptor.encrypt(data, password)
decrypted_data=rncryptor.decrypt(encrypted_data, password)
assertdata==decrypted_data# encrypt_with_keys and decrypt_with keys functionsencryption_salt='...'# 8 random bytesencryption_key=rncryptor.make_key(password, encryption_salt)
hmac_key=rncryptor.make_key(password, hmac_salt)
encrypted_data=rncryptor.encrypt_with_keys(data, hmac_key, encryption_key)
decrypted_data=rncryptor.decrypt_with_keys(encrypted_data, hmac_key, encryption_key)$ tox
$ tox -e py27 # test using only Python2.7
$ tox $(nproc)# run tests using all processesAn actual command can be found in tox.ini, but basically it's a common py.test with a bunch of plugins.