org.bouncycastle.crypto.engines
Class NaccacheSternEngine
java.lang.Objectorg.bouncycastle.crypto.engines.NaccacheSternEngine
- AsymmetricBlockCipher
public class NaccacheSternEngine
extends java.lang.Object
NaccacheStern Engine. For details on this cipher, please see
http://www.gemplus.com/smart/rd/publications/pdf/NS98pkcs.pdf
byte[] | addCryptedBlocks(byte[] block1, byte[] block2)- Adds the contents of two encrypted blocks mod sigma
|
byte[] | encrypt(BigInteger plain)- Encrypts a BigInteger aka Plaintext with the public key.
|
int | getInputBlockSize()- Returns the input block size of this algorithm.
|
int | getOutputBlockSize()- Returns the output block size of this algorithm.
|
void | init(boolean forEncryption, CipherParameters param)- Initializes this algorithm.
|
byte[] | processBlock(byte[] in, int inOff, int len)- Process a single Block using the Naccache-Stern algorithm.
|
byte[] | processData(byte[] data)- Convenience Method for data exchange with the cipher.
|
void | setDebug(boolean debug)
|
addCryptedBlocks
public byte[] addCryptedBlocks(byte[] block1,
byte[] block2)
throws InvalidCipherTextException Adds the contents of two encrypted blocks mod sigma
block1 - the first encrypted blockblock2 - the second encrypted block
- encrypt((block1 + block2) mod sigma)
encrypt
public byte[] encrypt(BigInteger plain)
Encrypts a BigInteger aka Plaintext with the public key.
plain - The BigInteger to encrypt
- The byte[] representation of the encrypted BigInteger (i.e.
crypted.toByteArray())
processData
public byte[] processData(byte[] data)
throws InvalidCipherTextException Convenience Method for data exchange with the cipher.
Determines blocksize and splits data to blocksize.
data - the data to be processed
- the data after it went through the NaccacheSternEngine.
setDebug
public void setDebug(boolean debug)