BASE64 encoding is a binary-to-character process that can be used to pass longer identity information in an HTTP environment.
Base64 is a string
Pom.xml Configuration
<dependency><groupid>commons-codec</groupid><artifactid>commons-codec</artifactid ><version>1.10</version></dependency>
Encrypt and decrypt code
/*** Decryption * *@parampwd *@return * @see[Class, Class # method, Class # member]*/ Public Staticstring Decodestr (string pwd) {Base64 base64=NewBase64 (); byte[] debytes = Base64.decodebase64 (NewString (PWD). GetBytes ()); return NewString (debytes); } /*** Encryption * *@parampwd *@return * @see[Class, Class # method, Class # member]*/ Public Staticstring Encodestr (string pwd) {Base64 base64=NewBase64 (); byte[] Enbytes =base64.encodebase64chunked (Pwd.getbytes ()); return NewString (enbytes); }
Java encryption and decryption of BASE64 images