Reputation: 10641
Everyone talks about the padding schemes in ciphers but what are the actual strings one needs to pass in to the cipher? I don't care if they are symmetric or asymmetric, I just want a list of the possible values.
Upvotes: 35
Views: 71341
Reputation: 15693
Block cyphers need padding, stream cyphers don't. Block cyphers need padding because they encrypt whole blocks, and your message may not exactly match a whole number of blocks. Padding is used to extend the message length to the next block boundary.
See the Wikipedia article on Cryptographic padding for a lot of detail.
For most purposes PKCS#7 (aka PKCS#5) padding is used: n bytes, all of value n:
01
02 02
03 03 03
...
10 10 10 10 ... 10 10
Upvotes: 12
Reputation: 24395
There are many types of padding, PKCS-7, Zero, ISO 10126, ANSI X.923, etc.
I suggest you read up on padding since you seem not to fully understand the concept.
Then there's the possibility you are referring to cryptographic salt.
Edit
Every implementation of the Java platform is required to support the following standard Cipher transformations with the keysizes in parentheses:
You can find a list here.
Edit 2
You can find the Bouncy Castle specification here. It lists all available padding schemes.
Upvotes: 56