IuKd2AQwEBiJMt15djesw6wgR/1jWJr/ZUM+XPIVkshHoPkhh2JhnqvEZt3VEYeY MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAut9/U5lR6UN/02YX79qv If you open up your public key file ( cat it or open it in a text editor), you’ll see something like this: -BEGIN PUBLIC KEY. We have to clean up the public key data though. Next, we need to read the public key file into our Java code. For that though, we need to first convert this string into a byte array: byte bytesToBeEncrypted = dataToBeEncrypted.getBytes() I have selected a very specific message to encrypt, and it makes a lot of sense: String dataToBeEncrypted = "Some random words in no particular order." Īs you can see, I can’t really send out this very sensitive message over public internet. Now that we have a key pair, let’s start encrypting our message.
0 Comments
Leave a Reply. |