Security
A simple helper for “I want to encrypt this chunk of text with a password” Requires installation of the cryptography library (q2 add_dependency cryptography)
Uses Cryptography’s fernet symmetrical encryption algorithm: https://cryptography.io/en/latest/fernet/
Usage:
from q2_sdk.core import security
unencrypted_string = "I am in need to encrypting"
secret_key = "supersecret"
encrypted_string = security.encrypt(unencrypted_string, secret_key)
new_unencrypted_string = security.decrypt(encrypted_string, secret_key)
assert unencrypted_string == new_unencrypted_string