Java8: Base64
Java 8 now has inbuilt encoder and decoder for Base64 encoding.
String original = "nuwan?demo";
String encoded = Base64.getEncoder().encodeToString(original.getBytes("utf-8"));
String decoded = new String(Base64.getDecoder().decode(encoded));
System.out.println(original+" > ENCODE > "+encoded+" > DECODE > "+decoded);Get Nuwan Zen’s stories in your inbox
Join Medium for free to get updates from this writer.
Output will be
nuwan?demo > ENCODE > bnV3YW4/ZGVtbw== > DECODE > nuwan?demo
Read my other blogs:





![[IronHold] — Spring Boot Source Code Analysis: Finding Credentials, SQL Injection, PrivEsc, and…](https://miro.medium.com/v2/resize:fit:1358/format:webp/1*2yaTo73YRGo1GknAUJNfPg.jpeg)

