diff --git a/doc/global.html b/doc/global.html index e78218e7..db1fa8dd 100644 --- a/doc/global.html +++ b/doc/global.html @@ -91,7 +91,7 @@
-

openpgp_crypto_asymetricDecrypt(algo, publicMPIs, secretMPIs, data) → {BigInteger}

+

openpgp_crypto_symmetricDecrypt(algo, key, data, openpgp_cfb) → {String}

@@ -99,1749 +99,8 @@
- Decrypts data using the specified public key multiprecision integers of the private key, -the specified secretMPIs of the private key and the specified algorithm. -
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
algo - - -Integer - - - - Algorithm to be used (See RFC4880 9.1)
publicMPIs - - -openpgp_type_mpi[] - - - - Algorithm dependent multiprecision integers -of the public key part of the private key
secretMPIs - - -openpgp_type_mpi[] - - - - Algorithm dependent multiprecision integers -of the private key used
data - - -openpgp_type_mpi - - - - Data to be encrypted as MPI
- - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
- returns a big integer containing the decrypted data; otherwise null -
- - - -
-
- Type -
-
- -BigInteger - - -
-
- - - - - - - - -
-

openpgp_crypto_asymetricEncrypt(algo, publicMPIs, data) → {openpgp_type_mpi|Array.<openpgp_type_mpi>}

- - -
-
- - -
- Encrypts data using the specified public key multiprecision integers -and the specified algorithm. -
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
algo - - -Integer - - - - Algorithm to be used (See RFC4880 9.1)
publicMPIs - - -openpgp_type_mpi[] - - - - Algorithm dependent multiprecision integers
data - - -openpgp_type_mpi - - - - Data to be encrypted as MPI
- - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
- if RSA an openpgp_type_mpi; -if elgamal encryption an array of two openpgp_type_mpi is returned; otherwise null -
- - - -
-
- Type -
-
- -openpgp_type_mpi -| - -Array.<openpgp_type_mpi> - - -
-
- - - - -
- - - -
-

openpgp_crypto_generateKeyPair(keyType, numBits) → {openpgp_keypair}

- - -
-
- - -
- Calls the necessary crypto functions to generate a keypair. -Called directly by openpgp.js -
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
keyType - - -Integer - - - - Follows OpenPGP algorithm convention.
numBits - - -Integer - - - - Number of bits to make the key to be generated
- - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -openpgp_keypair - - -
-
- - - - -
- - - -
-

openpgp_crypto_generateSessionKey(algo) → {String}

- - -
-
- - -
- Generating a session key for the specified symmetric algorithm -
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
algo - - -Integer - - - - Algorithm to use (see RFC4880 9.2)
- - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
- Random bytes as a string to be used as a key -
- - - -
-
- Type -
-
- -String - - -
-
- - - - -
- - - -
-

openpgp_crypto_getHashByteLength(algo) → {Integer}

- - -
-
- - -
- Returns the hash size in bytes of the specified hash algorithm type -
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
algo - - -Integer - - - - Hash algorithm type (See RFC4880 9.4)
- - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
- Size in bytes of the resulting hash -
- - - -
-
- Type -
-
- -Integer - - -
-
- - - - -
- - - -
-

openpgp_crypto_getPrefixRandom(algo) → {String}

- - -
-
- - -
- generate random byte prefix as string for the specified algorithm -
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
algo - - -Integer - - - - Algorithm to use (see RFC4880 9.2)
- - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
- Random bytes with length equal to the block -size of the cipher -
- - - -
-
- Type -
-
- -String - - -
-
- - - - -
- - - -
-

openpgp_crypto_getPseudoRandom(from, to) → {Integer}

- - -
-
- - -
- Return a pseudo-random number in the specified range -
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
from - - -Integer - - - - Min of the random number
to - - -Integer - - - - Max of the random number (max 32bit)
- - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
- A pseudo random number -
- - - -
-
- Type -
-
- -Integer - - -
-
- - - - -
- - - -
-

openpgp_crypto_getRandomBigInteger(bits) → {BigInteger}

- - -
-
- - -
- Create a secure random big integer of bits length -
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
bits - - -Integer - - - - Bit length of the MPI to create
- - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
- Resulting big integer -
- - - -
-
- Type -
-
- -BigInteger - - -
-
- - - - -
- - - -
-

openpgp_crypto_getRandomBytes(length) → {String}

- - -
-
- - -
- Retrieve secure random byte string of the specified length -
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
length - - -Integer - - - - Length in bytes to generate
- - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
- Random byte string -
- - - -
-
- Type -
-
- -String - - -
-
- - - - -
- - - -
-

openpgp_crypto_getSecureRandom(from, to) → {Integer}

- - -
-
- - -
- Return a secure random number in the specified range -
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
from - - -Integer - - - - Min of the random number
to - - -Integer - - - - Max of the random number (max 32bit)
- - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
- A secure random number -
- - - -
-
- Type -
-
- -Integer - - -
-
- - - - -
- - - -
-

openpgp_crypto_hashData(algo, data) → {String}

- - -
-
- - -
- Create a hash on the specified data using the specified algorithm -
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
algo - - -Integer - - - - Hash algorithm type (see RFC4880 9.4)
data - - -String - - - - Data to be hashed
- - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
- hash value -
- - - -
-
- Type -
-
- -String - - -
-
- - - - -
- - - -
-

openpgp_crypto_MDCSystemBytes(algo, key, data) → {String}

- - -
-
- - -
- retrieve the MDC prefixed bytes by decrypting them + Symmetrically decrypts data using a key with length depending on the +algorithm in openpgp_cfb mode with or without resync (MDC style)
@@ -1937,7 +196,31 @@ size of the cipher - Encrypted data where the prefix is decrypted from + Data to be decrypted + + + + + + + openpgp_cfb + + + + + +Boolean + + + + + + + + + + If true use the resync (for encrypteddata); +otherwise use without the resync (for MDC encrypted data) @@ -1968,7 +251,7 @@ size of the cipher
Source:
@@ -1993,7 +276,7 @@ size of the cipher
- Plain text data of the prefixed data + Plaintext data
@@ -2018,7 +301,7 @@ size of the cipher
-

openpgp_crypto_signData(hash_algo, algo, publicMPIs, secretMPIs, data) → {String|openpgp_type_mpi}

+

openpgp_crypto_symmetricEncrypt(prefixrandom, algo, key, data, openpgp_cfb) → {String}

@@ -2026,7 +309,9 @@ size of the cipher
- Create a signature on data using the specified algorithm + Symmetrically encrypts data using prefixedrandom, a key with length +depending on the algorithm in openpgp_cfb mode with or without resync +(MDC style)
@@ -2060,13 +345,13 @@ size of the cipher - hash_algo + prefixrandom -Integer +String @@ -2076,7 +361,9 @@ size of the cipher - hash Algorithm to use (See RFC4880 9.4) + Secure random bytes as string in +length equal to the block size of the algorithm used (use +openpgp_crypto_getPrefixRandom(algo) to retrieve that string @@ -2099,20 +386,20 @@ size of the cipher - Asymmetric cipher algorithm to use (See RFC4880 9.1) + Algorithm to use (see RFC4880 9.2) - publicMPIs + key -openpgp_type_mpi[] +String @@ -2122,32 +409,7 @@ size of the cipher - Public key multiprecision integers -of the private key - - - - - - - secretMPIs - - - - - -openpgp_type_mpi[] - - - - - - - - - - Private key multiprecision -integers which is used to sign the data + Key as string. length is depending on the algorithm used @@ -2170,7 +432,30 @@ integers which is used to sign the data - Data to be signed + Data to encrypt + + + + + + + openpgp_cfb + + + + + +Boolean + + + + + + + + + + @@ -2201,233 +486,7 @@ integers which is used to sign the data
Source:
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -String -| - -openpgp_type_mpi - - -
-
- - - - - - - - -
-

openpgp_crypto_verifySignature(algo, hash_algo, msg_MPIs, publickey_MPIs, data) → {Boolean}

- - -
-
- - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
algo - - -Integer - - - - public Key algorithm
hash_algo - - -Integer - - - - Hash algorithm
msg_MPIs - - -openpgp_type_mpi[] - - - - Signature multiprecision integers
publickey_MPIs - - -openpgp_type_mpi[] - - - - Public key multiprecision integers
data - - -String - - - - Data on where the signature was computed on.
- - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
@@ -2452,7 +511,7 @@ integers which is used to sign the data
- true if signature (sig_data was equal to data over hash) + Encrypted data
@@ -2463,7 +522,7 @@ integers which is used to sign the data
-Boolean +String
@@ -2478,132 +537,6 @@ integers which is used to sign the data -

Type Definitions

- -
- -
-

openpgp_keypair

- - -
-
- - - -
- - -
Properties:
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
privateKey - - -openpgp_packet_keymaterial - - - -
publicKey - - -openpgp_packet_keymaterial - - - -
- - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - -
- -
- @@ -2616,13 +549,13 @@ integers which is used to sign the data
- Documentation generated by JSDoc 3.2.0-dev on Fri Apr 12 2013 12:58:17 GMT+0200 (CEST) + Documentation generated by JSDoc 3.2.0-dev on Fri Apr 12 2013 13:03:34 GMT+0200 (CEST)
diff --git a/doc/index.html b/doc/index.html index 5f1486f7..b1030897 100644 --- a/doc/index.html +++ b/doc/index.html @@ -48,13 +48,13 @@
- Documentation generated by JSDoc 3.2.0-dev on Fri Apr 12 2013 12:58:17 GMT+0200 (CEST) + Documentation generated by JSDoc 3.2.0-dev on Fri Apr 12 2013 13:03:34 GMT+0200 (CEST)
diff --git a/src/ciphers/openpgp.crypto.sym.js b/src/ciphers/openpgp.crypto.sym.js index 5a2be9d6..30879a7d 100644 --- a/src/ciphers/openpgp.crypto.sym.js +++ b/src/ciphers/openpgp.crypto.sym.js @@ -21,14 +21,14 @@ * Symmetrically encrypts data using prefixedrandom, a key with length * depending on the algorithm in openpgp_cfb mode with or without resync * (MDC style) - * @param prefixrandom secure random bytes as string in length equal to the - * block size of the algorithm used (use openpgp_crypto_getPrefixRandom(algo) - * to retrieve that string - * @param algo [Integer] algorithm to use (see RFC4880 9.2) - * @param key [String] key as string. length is depending on the algorithm used - * @param data [String] data to encrypt - * @param openpgp_cfb [boolean] - * @return [String] encrypted data + * @param {String} prefixrandom Secure random bytes as string in + * length equal to the block size of the algorithm used (use + * openpgp_crypto_getPrefixRandom(algo) to retrieve that string + * @param {Integer} algo Algorithm to use (see RFC4880 9.2) + * @param {String} key Key as string. length is depending on the algorithm used + * @param {String} data Data to encrypt + * @param {Boolean} openpgp_cfb + * @return {String} Encrypted data */ function openpgp_crypto_symmetricEncrypt(prefixrandom, algo, key, data, openpgp_cfb) { switch(algo) { @@ -57,12 +57,12 @@ function openpgp_crypto_symmetricEncrypt(prefixrandom, algo, key, data, openpgp_ /** * Symmetrically decrypts data using a key with length depending on the * algorithm in openpgp_cfb mode with or without resync (MDC style) - * @param algo [Integer] algorithm to use (see RFC4880 9.2) - * @param key [String] key as string. length is depending on the algorithm used - * @param data [String] data to be decrypted - * @param openpgp_cfb [boolean] if true use the resync (for encrypteddata); + * @param {Integer} algo Algorithm to use (see RFC4880 9.2) + * @param {String} key Key as string. length is depending on the algorithm used + * @param {String} data Data to be decrypted + * @param {Boolean} openpgp_cfb If true use the resync (for encrypteddata); * otherwise use without the resync (for MDC encrypted data) - * @return [String] plaintext data + * @return {String} Plaintext data */ function openpgp_crypto_symmetricDecrypt(algo, key, data, openpgp_cfb) { util.print_debug_hexstr_dump("openpgp_crypto_symmetricDecrypt:\nalgo:"+algo+"\nencrypteddata:",data); @@ -91,4 +91,4 @@ function openpgp_crypto_symmetricDecrypt(algo, key, data, openpgp_cfb) { default: } return null; -} \ No newline at end of file +}