Java: Base64 Encode a String using a key

Abhishek picture Abhishek · Jun 14, 2011 · Viewed 38.2k times · Source

Hi I have data and a key (both strings). The data needs to be encode using the key using Base64. Can some one give me a sample code.

Answer

Vincent Koeman picture Vincent Koeman · Jun 14, 2011

Base64 is not for 'encoding with a key'. It is simply a encoding scheme: you can use Base64 to encrypt and decrypt strings without any extra's. It's just for very (very) basic security usages.