Java How to Encrypt / Decrypt with AES in Java 1.8 Here I have created a class that does it in two different ways, the first one is, when you create the key, and the other is when you are given the key, valid key sizes are 128, 192, and 256 for AES algorithm. There is some steps to follow before
Java How to generate X.509 certificate in Java 1.8 Here is how to do it, the simplest way, to generate the base64 string. No complications with KeyStores or things like that. I must say that I found this code in several places over the Internet. When I tried to run it I had some exceptions, I solved them, at
Java How to generate RSA key pair in Java 1.8 Recently I was wondering how to generate a private key in Java for a personal project. I found out how to generate the actual key pair with RSA algorithm. Here is the java code for that, a simple class that you can run to check how things work. import java.
Java How to convert byte array to hex string in Java 1.8 If you like cryptography you might know that sometimes you have a byte array which you wish to convert to hexadecimal string. In java, to this day, I haven’t found yet a native class that does it, I’ve spent several minutes on the Internet looking for something like