-
-
Save dreid/f7183ef663afea65cf6d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from cryptography.hazmat.backends import openssl, commoncrypto, default_backend | |
from cryptography.fernet import Fernet | |
def encrypt(backend): | |
f = Fernet(Fernet.generate_key(), backend=backend) | |
return f.encrypt(b"my deep dark secret") | |
print "OpenSSL Version: ", openssl.backend.openssl_version_text() | |
print "CommonCrypto: ", encrypt(commoncrypto.backend) | |
print "OpenSSL: ", encrypt(openssl.backend) | |
print "Default: ", encrypt(default_backend()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment