Crypto.sym
This commit is contained in:
parent
8545feb03d
commit
6242e72a1d
2211
doc/global.html
2211
doc/global.html
File diff suppressed because it is too large
Load Diff
|
@ -48,13 +48,13 @@
|
|||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Index</a></h2><h3>Global</h3><ul><li><a href="global.html#openpgp_crypto_asymetricDecrypt">openpgp_crypto_asymetricDecrypt</a></li><li><a href="global.html#openpgp_crypto_asymetricEncrypt">openpgp_crypto_asymetricEncrypt</a></li><li><a href="global.html#openpgp_crypto_generateKeyPair">openpgp_crypto_generateKeyPair</a></li><li><a href="global.html#openpgp_crypto_generateSessionKey">openpgp_crypto_generateSessionKey</a></li><li><a href="global.html#openpgp_crypto_getHashByteLength">openpgp_crypto_getHashByteLength</a></li><li><a href="global.html#openpgp_crypto_getPrefixRandom">openpgp_crypto_getPrefixRandom</a></li><li><a href="global.html#openpgp_crypto_getPseudoRandom">openpgp_crypto_getPseudoRandom</a></li><li><a href="global.html#openpgp_crypto_getRandomBigInteger">openpgp_crypto_getRandomBigInteger</a></li><li><a href="global.html#openpgp_crypto_getRandomBytes">openpgp_crypto_getRandomBytes</a></li><li><a href="global.html#openpgp_crypto_getSecureRandom">openpgp_crypto_getSecureRandom</a></li><li><a href="global.html#openpgp_crypto_hashData">openpgp_crypto_hashData</a></li><li><a href="global.html#openpgp_crypto_MDCSystemBytes">openpgp_crypto_MDCSystemBytes</a></li><li><a href="global.html#openpgp_crypto_signData">openpgp_crypto_signData</a></li><li><a href="global.html#openpgp_crypto_verifySignature">openpgp_crypto_verifySignature</a></li></ul>
|
||||
<h2><a href="index.html">Index</a></h2><h3>Global</h3><ul><li><a href="global.html#openpgp_crypto_symmetricDecrypt">openpgp_crypto_symmetricDecrypt</a></li><li><a href="global.html#openpgp_crypto_symmetricEncrypt">openpgp_crypto_symmetricEncrypt</a></li></ul>
|
||||
</nav>
|
||||
|
||||
<br clear="both">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a> on Fri Apr 12 2013 12:58:17 GMT+0200 (CEST)
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a> on Fri Apr 12 2013 13:03:34 GMT+0200 (CEST)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user