What does this do?
Good afternoon all!
I found some sample encryption code and I am wondering what the statement below does. Currently the code encrypts or decrypts file and I am going to be using it as a "roadmap" to create a program to encrypt and decrypt byte[].
byte[] buf = cipherMode == Cipher.ENCRYPT_MODE?newbyte[100] :newbyte[128];
Thanks,
Doug
Here is a bigger code piece if needed:
Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
String textLine =null;
//RSA encryption data size limitations are slightly less than the key modulus size,
//depending on the actual padding scheme used (e.g. with 1024 bit (128 byte) RSA key,
//the size limit is 117 bytes for PKCS#1 v 1.5 padding. (http://www.jensign.com/JavaScience/dotnet/RSAEncrypt/)
byte[] buf = cipherMode == Cipher.ENCRYPT_MODE?newbyte[100] :newbyte[128];
int bufl;
// init the Cipher object for Encryption...

