|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--net.rim.device.api.crypto.OAEPUnformatterEngine
Referenced from site http://www.rsa.com/.
Optimal Asymmetric Encryption Padding (OAEP) is a method for encoding messages developed by Mihir Bellare and Phil Rogaway [BR94]. The technique of encoding a message with OAEP and then encrypting it with RSA is provably secure in the random oracle model. Informally, this means that if hash functions are truly random, then an adversary who can recover such a message must be able to break RSA.
An OAEP encoded message consists of a ``masked data'' string concatenated
with a ``masked random number''. In the simplest form of OAEP, the masked data
is formed by taking the XOR of the plaintext message M and the hash G of a random
string r. The masked random number is the XOR of r with the hash H of the masked
data. The input to the RSA encryption function is then:
[M XOR G(r)] || [r XOR H(M XOR G(r))]
Often, OAEP is used to encode small items such as keys. There are other variations on OAEP (differing only slightly from the above) that include a feature called ``plaintext-awareness''. This means that to construct a valid OAEP encoded message, an adversary must know the original plaintext. To accomplish this, the plaintext message M is first padded (for example, with a string of zeroes) before the masked data is formed. OAEP is supported in the ANSI X9.44, IEEE P1363 and SET standards.
For a code sample using the OAEP unformatter engine, click here.
OAEPFormatterEngine| Constructor Summary | ||
|
OAEPUnformatterEngine(PrivateKeyDecryptorEngine engine)
Creates an OAEPUnformatterEngine object based upon the given decryptor engine, as well as the
SHA-1 digest algorithm. |
|
|
OAEPUnformatterEngine(PrivateKeyDecryptorEngine engine,
byte[] parameters)
Creates an OAEPUnformatterEngine object based upon the given decryptor engine, as well as the
SHA-1 digest algorithm, and the given parameters. |
|
|
OAEPUnformatterEngine(PrivateKeyDecryptorEngine engine,
Digest digest)
Creates an OAEPUnformatterEngine object based upon the given decryptor engine and digest
algorithm. |
|
|
OAEPUnformatterEngine(PrivateKeyDecryptorEngine engine,
Digest digest,
byte[] parameters)
Creates an OAEPUnformatterEngine object based upon the given decryptor engine, digest
algorithm and parameters. |
|
| Method Summary | ||
|
int |
decryptAndUnformat(byte[] input,
int inputOffset,
byte[] output,
int outputOffset)
Decrypts the input and then "unformats" it into the original plaintext assuming this block is not the last block in the stream. |
|
int |
decryptAndUnformat(byte[] input,
int inputOffset,
byte[] output,
int outputOffset,
boolean lastBlock)
Decrypts the input and then "unformats" it into the original plaintext. |
|
String |
getAlgorithm()
Returns the name of the algorithm used, ie PublicKeyEncryptorEngine.getAlgorithm() + "_OAEP". |
|
int |
getInputBlockLength()
Returns the length of an input block in bytes. |
|
int |
getOutputBlockLength()
Returns the length of an output block in bytes. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public OAEPUnformatterEngine(PrivateKeyDecryptorEngine engine)
OAEPUnformatterEngine object based upon the given decryptor engine, as well as the
SHA-1 digest algorithm.
engine - The PrivateKeyDecryptorEngine used to decrypt the formatted message.public OAEPUnformatterEngine(PrivateKeyDecryptorEngine engine, byte[] parameters)
OAEPUnformatterEngine object based upon the given decryptor engine, as well as the
SHA-1 digest algorithm, and the given parameters.
engine - The PrivateKeyDecryptorEngine used to decrypt the formatted message.parameters - A byte array containing the parameters to be compared to those found in the formatted message.public OAEPUnformatterEngine(PrivateKeyDecryptorEngine engine, Digest digest)
OAEPUnformatterEngine object based upon the given decryptor engine and digest
algorithm.
engine - The PrivateKeyDecryptorEngine object used to decrypt the formatted message.digest - The digest to be used during the unformatting process.public OAEPUnformatterEngine(PrivateKeyDecryptorEngine engine, Digest digest, byte[] parameters)
OAEPUnformatterEngine object based upon the given decryptor engine, digest
algorithm and parameters.
engine - The PrivateKeyDecryptorEngine object used to decrypt the formatted message.digest - The digest to be used during the unformatting process.parameters - A byte array containing teh paramters to be compared to those found in the formatted message.| Method Detail |
public int decryptAndUnformat(byte[] input,
int inputOffset,
byte[] output,
int outputOffset)
throws DecodeException,
BadPaddingException,
CryptoTokenException
BlockUnformatterEngine
BlockUnformatterEngineinput - A byte array containing the encoded ciphertext.inputOffset - The offset, or initial bit position, of the data within the byte array.output - The byte array that will contain the plaintext.outputOffset - The offset, or initial bit position, of the data within the byte array.DecodeException - Thrown if the input cannot be decoded properly.BadPaddingException - Thrown if the input has improper padding.CryptoTokenException - Thrown when a problem occurs with a crypto token or the crypto token is invalid.
public int decryptAndUnformat(byte[] input,
int inputOffset,
byte[] output,
int outputOffset,
boolean lastBlock)
throws DecodeException,
BadPaddingException,
CryptoTokenException
BlockUnformatterEngine
BlockUnformatterEngineinput - A byte array containing the encoded ciphertext.inputOffset - The offset, or initial bit position, of the data within the byte array.output - The byte array that will contain the plaintext.outputOffset - The offset, or initial bit position, of the data
within the byte array.lastBlock - A boolean flag indicating whether this is the last block in the
stream to be decrypted.DecodeException - Thrown if the input cannot be decoded properly.BadPaddingException - Thrown if the input has improper padding.CryptoTokenException - Thrown when a problem occurs with a crypto token or the crypto token is invalid.public String getAlgorithm()
PublicKeyEncryptorEngine.getAlgorithm() + "_OAEP".
BlockUnformatterEnginepublic int getInputBlockLength()
BlockUnformatterEngine
BlockUnformatterEnginepublic int getOutputBlockLength()
BlockUnformatterEngine
BlockUnformatterEngine
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2009 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.