From 39aa137160080936b18cb484fe7bd85cb57cf404 Mon Sep 17 00:00:00 2001 From: 0xflotus <0xflotus@gmail.com> Date: Fri, 18 Dec 2020 00:03:42 +0100 Subject: [PATCH] chore: enabled syntax highlighting --- README.md | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ec69581..404021a 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,9 @@ This shorter key ID can be used to uniquely identify Sam's public key more easil ## RSA Keys - cryptico.generateRSAKey(passphrase, bitlength) +```javascript +cryptico.generateRSAKey(passphrase, bitlength) +``` Generates an RSAKey object from a password and bitlength. @@ -102,7 +104,9 @@ Generates an RSAKey object from a password and bitlength. Returns an `RSAKey` object. - cryptico.publicKeyString(rsakey) +```javascript +cryptico.publicKeyString(rsakey) +``` Returns the public key portion of an RSAKey object in ascii-armored string form, which allows it to be used on websites and in text files @@ -112,7 +116,9 @@ without fear of corrupting the public key. Returns an ascii-armored public key string. - cryptico.publicKeyID(publicKeyString) +```javascript +cryptico.publicKeyID(publicKeyString) +``` Returns an MD5 sum of a `publicKeyString` for easier identification. @@ -122,7 +128,9 @@ Returns an MD5 sum of the public key string. ## Encryption - cryptico.encrypt(plaintext, publicKeyString, signingKey) +```javascript +cryptico.encrypt(plaintext, publicKeyString, signingKey) +``` Encrypts a string with the provided public key. Optionally signs the encrypted string with an RSAKey object. @@ -140,7 +148,9 @@ Returns: `status`, `cipher` ## Decryption - cryptico.decrypt(ciphertext, key) +```javascript +cryptico.decrypt(ciphertext, key) +``` Decrypts an encrypted message with the recipient's RSAKey and verifies the signature, if any. @@ -193,4 +203,4 @@ plaintext, the public key of the sender, and the signature: signature This concatenated block is then encrypted with CBC AES and concatenated with the -encrypted AES key to form the complete encrypted message. \ No newline at end of file +encrypted AES key to form the complete encrypted message.