Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

chore: enabled syntax highlighting #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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
Expand All @@ -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.

Expand All @@ -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.

Expand All @@ -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.

Expand Down Expand Up @@ -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.
encrypted AES key to form the complete encrypted message.