0

I have a string holding some parameters that needs to be encrypted in AES-128 in ECB mode with PKCS7 padding, and then Base-64 encoded.

My code base is Java 1.4. Is this possible with Java 1.4 api ?

jdoyle0116
  • 83
  • 2
  • 12

1 Answers1

0

Yes, you can. You would need a separate library for the base 64 encoding/decoding though. For the encryption you can use Cipher.getInstance("AES/ECB/PKCS5Padding"). Note that PKCS#5 padding is the same as PKCS#7 padding.

Community
  • 1
  • 1
Maarten Bodewes
  • 90,524
  • 13
  • 150
  • 263
  • Note that you shouldn't try and program security related applications on a runtime that doesn't receive security updates anymore. Try and see if you can get it compiling / running on Java 1.8 instead; Java RE is highly backwards compatible (although it *is* possible to break compatibility of course). – Maarten Bodewes Nov 01 '14 at 22:38