Open Devessier opened 3 years ago
Quand on passe un sel et une clef à OpenSSL, mais pas de mdp, il n'y a pas de sel écrit sur la sortie standard. Essayer:
cat auteur | openssl enc -des-ecb -md sha256 -pbkdf2 -iter 10000 -K AABB09182736CCDD -S AABB09182736CCDD
Implementing DES command necessitates to implement two different mechanisms first:
PBKDF
To have a working PBKDF, we need:
The steps to follow are:
/dev/random
HMAC SHA-256
algorithm, usingSHA-256
PBKDF2
algorithm, using Salt, Password andHMAC SHA-256
To debug and test more easily, we will probably have to add a digest command
HMAC SHA-256
and a parameter-debug
to printIV
andKey
.PBKDF RFC can be found there: https://tools.ietf.org/html/rfc8018#section-5.2. HMAC RFC can be found there: https://www.ietf.org/rfc/rfc2104.txt.
To use a better version of openssl, we had to follow those instructions: https://stackoverflow.com/questions/61938795/openssl-pbkdf2-option-no-longer-supported.
DES-ECB
The first DES version to implement is DES-ECB. We can find an algorithm definition there: https://csrc.nist.gov/csrc/media/publications/fips/46/3/archive/1999-10-25/documents/fips46-3.pdf. We can find an example implementation there: https://www.geeksforgeeks.org/data-encryption-standard-des-set-1/.
We will have to implement other block cipher modes of operation so we should structure carefully our code.
DES-CBC
We have to use another block cipher mode of operation, as described above.