weidai11 / cryptopp

free C++ class library of cryptographic schemes
https://cryptopp.com
Other
4.66k stars 1.47k forks source link

Django cipher texts not matching Crypto++ cipher texts. #1254

Open drizzle042 opened 6 months ago

drizzle042 commented 6 months ago

Thank you so much for many years of hard work and devotion.

This isn’t really an issue but a question. Unfortunately the Google group is down.

I am working with a database of cipher texts derived using PBKDF2 HMAC SHA2 256 key derivation function in Python Django. I am migrating the application to C++ so I chose Crypto++.

Unfortunately I couldn’t get to generate equivalent ciphers using the same parameters as used in Django. This is probably what Django does that I couldn’t get to do with the library:

b64encode.b64encode(hash).decode("ascii").strip()

The hash I am wont to believe is a sequence of bytes which Django produces with the hashing algorithm PBKDF2 HMAC SHA2 256 and it encodes to Base64 bytes before then decoding to ASCII characters.

I am wont to believe that Crypto++ does something similar. It produces a sequence of bytes, then the user can encode the byte sequence to Base64.

Which character set is then used for representation? UTF8? ASCII? UTF16?

Your answer will be very much appreciated.