RSA
Classes
RSA
Kind: global class
this: {"{"}RSA{"}"}
new RSA()
Creates an instance of RSA
RSA.bytestohex(b) ⇒
Convert byte array to hex string
Kind: static method of RSA
Returns: s hex string
this: {"{"}RSA{"}"}
Param | Description |
---|---|
b | byte array |
RSA.bytestostring(b) ⇒
Convert byte array to string
Kind: static method of RSA
Returns: s string
this: {"{"}RSA{"}"}
Param | Description |
---|---|
b | byte array |
RSA.stringtobytes(s) ⇒
Convert a string to byte array
Kind: static method of RSA
Returns: b byte array
this: {"{"}RSA{"}"}
Param | Description |
---|---|
s | string |
RSA.hashit(sha, A, n) ⇒
General purpose hash function
Kind: static method of RSA
Returns: R hash value
this: {"{"}RSA{"}"}
Param | Description |
---|---|
sha | is the hash type |
A | byte array |
n | Integer |
RSA.KEY_PAIR(rng, e, PRIV, PUB)
RSA Key Pair Generator
Kind: static method of RSA
this: {"{"}RSA{"}"}
Param | Description |
---|---|
rng | is a pointer to a cryptographically secure random number generator |
e | the encryption exponent |
PRIV | the output RSA private key |
PUB | the output RSA public key |
RSA.PKCS15(rng, e, PRIV, PUB) ⇒
PKCS V1.5 padding of a message prior to RSA signature
Kind: static method of RSA
Returns: true or false
this: {"{"}RSA{"}"}
Param | Description |
---|---|
rng | is a pointer to a cryptographically secure random number generator |
e | the encryption exponent |
PRIV | the output RSA private key |
PUB | the output RSA public key |
RSA.OAEP_ENCODE(sha, m, rng, P) ⇒
OAEP padding of a message prior to RSA encryption
Kind: static method of RSA
Returns: f is the output encoding, ready for RSA encryption
this: {"{"}RSA{"}"}
Param | Description |
---|---|
sha | is the hash type |
m | is the input message |
rng | is a pointer to a cryptographically secure random number generator |
P | are input encoding parameter string (could be NULL) |
RSA.OAEP_DECODE(sha, P, f) ⇒
OAEP unpadding of a message after RSA decryption
Kind: static method of RSA
Returns: r is the unpadded message
this: {"{"}RSA{"}"}
Param | Description |
---|---|
sha | is the hash type |
P | are input encoding parameter string (could be NULL) |
f | is the padded message |
RSA.PRIVATE_KEY_KILL(PRIV)
Destroy an RSA private Key
Kind: static method of RSA
this: {"{"}RSA{"}"}
Param | Description |
---|---|
PRIV | the input RSA private key. Destroyed on output. |
RSA.ENCRYPT(PUB, F, G)
RSA encryption of suitably padded plaintext
Kind: static method of RSA
this: {"{"}RSA{"}"}
Param | Description |
---|---|
PUB | the input RSA public key |
F | is input padded message |
G | is the output ciphertext |
RSA.DECRYPT(PRIV, G, F)
RSA decryption of ciphertext
Kind: static method of RSA
this: {"{"}RSA{"}"}
Param | Description |
---|---|
PRIV | the input RSA private key |
G | is the input ciphertext |
F | is output plaintext (requires unpadding) |
rsa_private_key
Kind: global class
this: {"{"}rsa_private_key{"}"}
new rsa_private_key(n)
Creates an instance of rsa_private_key
Param | Description |
---|---|
n | FF length |
rsa_public_key
Kind: global class
this: {"{"}rsa_private_key{"}"}
new rsa_public_key(m)
Creates an instance of rsa_public_key
Param | Description |
---|---|
m | FF length |