I want to use AES encryption with ISO9797 M2 Padding . But in not under java by standard padding modes Cipher Algorithm Padding
How to implement ..?
Thank’s
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.
If it is not available in standard Java, then you could implement it yourself, and add the appropriate bytes to the end of your plaintext. Then encrypt using
NoPaddingso you don’t get extra padding added. Decrypt usingNoPaddingagain, and then remove the padding yourself.The padding scheme is very simple to implement:
I had a quick look at the Bouncy Castle library, and that does not appear to have ISO 9797 either.