Top Description Fields Constructors Methods
org.bouncycastle.crypto.engines

public Class RSABlindingEngine

extends Object
implements AsymmetricBlockCipher
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.AsymmetricBlockCipher
Imports
java.math.BigInteger, org.bouncycastle.crypto.AsymmetricBlockCipher, .CipherParameters, .DataLengthException, org.bouncycastle.crypto.params.ParametersWithRandom, .RSABlindingParameters, .RSAKeyParameters, org.bouncycastle.util.BigIntegers

This does your basic RSA Chaum's blinding and unblinding as outlined in "Handbook of Applied Cryptography", page 475. You need to use this if you are trying to get another party to generate signatures without them being aware of the message they are signing.

Field Summary

Modifier and TypeField and Description
private BigInteger
private RSACoreEngine
private boolean
private RSAKeyParameters

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private BigInteger
public int

Returns:

maximum size for an input block.
getInputBlockSize
()

Implements org.bouncycastle.crypto.AsymmetricBlockCipher.getInputBlockSize.

Return the maximum size for an input block to this engine.

public int

Returns:

maximum size for an output block.
getOutputBlockSize
()

Implements org.bouncycastle.crypto.AsymmetricBlockCipher.getOutputBlockSize.

Return the maximum size for an output block to this engine.

public void
init(boolean
true if we are encrypting (blinding), false otherwise.
forEncryption
,
CipherParameters
the necessary RSA key parameters.
param
)

Implements org.bouncycastle.crypto.AsymmetricBlockCipher.init.

Initialise the blinding engine.

public byte[]

Returns:

the result of the RSA process.
processBlock
(byte[]
the input array.
in
,
int
the offset into the input buffer where the data starts.
inOff
,
int
the length of the data to be processed.
inLen
)

Implements org.bouncycastle.crypto.AsymmetricBlockCipher.processBlock.

Process a single block using the RSA blinding algorithm.

private BigInteger
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

blindingFactorback to summary
private BigInteger blindingFactor
coreback to summary
private RSACoreEngine core
forEncryptionback to summary
private boolean forEncryption
keyback to summary
private RSAKeyParameters key

Constructor Detail

RSABlindingEngineback to summary
public RSABlindingEngine()

Method Detail

blindMessageback to summary
private BigInteger blindMessage(BigInteger msg)
getInputBlockSizeback to summary
public int getInputBlockSize()

Implements org.bouncycastle.crypto.AsymmetricBlockCipher.getInputBlockSize.

Return the maximum size for an input block to this engine. For RSA this is always one byte less than the key size on encryption, and the same length as the key size on decryption.

Returns:int

maximum size for an input block.

getOutputBlockSizeback to summary
public int getOutputBlockSize()

Implements org.bouncycastle.crypto.AsymmetricBlockCipher.getOutputBlockSize.

Return the maximum size for an output block to this engine. For RSA this is always one byte less than the key size on decryption, and the same length as the key size on encryption.

Returns:int

maximum size for an output block.

initback to summary
public void init(boolean forEncryption, CipherParameters param)

Implements org.bouncycastle.crypto.AsymmetricBlockCipher.init.

Initialise the blinding engine.

Parameters
forEncryption:boolean

true if we are encrypting (blinding), false otherwise.

param:CipherParameters

the necessary RSA key parameters.

processBlockback to summary
public byte[] processBlock(byte[] in, int inOff, int inLen)

Implements org.bouncycastle.crypto.AsymmetricBlockCipher.processBlock.

Process a single block using the RSA blinding algorithm.

Parameters
in:byte[]

the input array.

inOff:int

the offset into the input buffer where the data starts.

inLen:int

the length of the data to be processed.

Returns:byte[]

the result of the RSA process.

Exceptions
DataLengthException:
the input block is too large.
unblindMessageback to summary
private BigInteger unblindMessage(BigInteger blindedMsg)