I am using Fernet encryption from python cryptography.fernet and generated the key as below
salt = os.urandom(16) kdf = PBKDF2HMAC( algorithm=hashes.SHA256(), length=32, salt=salt, iterations=78643, backend=default_backend() ) key = base64.urlsafe_b64encode(kdf.derive(password))
fernet = Fernet(key) fernet.encrypt(data)
The generated key is like
fernet.encrypt(data) - Internal it used AES 128 CBC algorithm for encryption.
Problem: Entropy of Encrypted content is very low, Shannon Entropy: 5.9, usually the entropy for encrypted is around 7.9.
Question: What make the encrypted content looks like Text? How to identify the content is encrypted? as entropy is very low.
Note the below method gives entropy around 7.9
key=b'\xcb\x98\xa8\xb6\x94jU\xe8\x92zdR\xa0\x1a\xae\xec' aes = AES.new(key, AES.MODE_CTR, counter=Counter.new(128)) aes.encrypt(data)