|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--dmc.RSA
Implementation of the Rivest, Shamir, Adleman algorithm for asymmetric cryptography.
Constructor Summary | |
RSA(int bitlen)
Generates private/public key pair of lenth bitlen. |
Method Summary | |
java.lang.String |
decrypt(java.math.BigInteger msg)
Decrypts msg using our private key. |
java.lang.String |
encrypt(java.math.BigInteger msg)
Encrypts msg using our public key. |
java.lang.String |
encrypt(java.math.BigInteger msg,
java.lang.String publicKey)
Overloaded version of encrypt to encrypt with an arbitrary public key in the format "e n", such as those produced by getPublicKey(). |
java.lang.String |
getPublicKey()
Returns this public key in the form "e n". |
java.lang.String |
sign(java.math.BigInteger msg)
Signs msg using our private key. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RSA(int bitlen)
Method Detail |
public java.lang.String encrypt(java.math.BigInteger msg)
msg
- Cleartext to encrypt.
public java.lang.String decrypt(java.math.BigInteger msg)
msg
- Ciphertext to be decrypted.
public java.lang.String sign(java.math.BigInteger msg)
msg
- Cleartext to signed.
public java.lang.String getPublicKey()
public java.lang.String encrypt(java.math.BigInteger msg, java.lang.String publicKey)
msg
- Cleartext to be encrypted.publicKey
- Public key used to encrypt, in the form
"e n" as a hexbin string.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |