Could you help me to point out what is the default RSA padding.
Precisely, if I create cipher instance as below, sure java is using some sort of padding as encrypted text bytes length always shows 256 bytes for 2048 RSA key irrespective of plain text is one characters or 10 characters.
I wanted to know what is default padding java use internally if no padding is specified in Cipher.getInstance("RSA"). is that PKCS#1 v 1.5?
When no padding or block mode are specified the default is "RSA/ECB/PKCS1Padding". PKCS1Padding takes a minimum of 11 bytes and takes the cleartext length to the length of the modulus. When used to encrypt the padding has a header and footer with a filler of random bytes. When used to create a signature the filler is non-random bytes. I can't remember the detail of the padding but I'm sure Google will find it. You can specify RSA/ECB/NoPadding but this is generally considered insecure since encryption of a short cleartext can allow a simple brute force attack to reveal the private key exponent.