I’m just confused about what’s the padding mode used when use crypto:des_ecb_encrypt/2 in erlang.
Thanks in advance!
I’m just confused about what’s the padding mode used when use crypto:des_ecb_encrypt/2 in erlang.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To find out, encrypt some plaintext that is not a whole number of blocks. Decrypt it with “no padding” set, and see what the encryption process added to the end of the last block.
If encryption fails, then it is probably expecting you to add your own padding first. As has been said, use PKCS5 or PKCS7 padding.