Skip to content

Commit

Permalink
rename to string-crypto
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanlescure committed Oct 1, 2020
1 parent 5668e9d commit 369f9f7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# String Crypt
# String Crypto

Small and and simple (yet secure) library to encrypt and decrypt strings using PBKDF2 for key derivation and AES (defaulted to 256-bit / SHA512).

Expand All @@ -8,16 +8,16 @@ Please consider:

- [Buying me a coffee](https://www.buymeacoffee.com/jeanlescure) :coffee:
- Supporting me on [Patreon](https://www.patreon.com/jeanlescure) :trophy:
- Starring this repo on [Github](https://github.com/jeanlescure/string-crypt) :star2: :octocat:
- Starring this repo on [Github](https://github.com/jeanlescure/string-crypto) :star2: :octocat:

## Usage

```
yarn add string-crypt
yarn add string-crypto
```

```ts
import StringCrypt from 'string-crypt';
import StringCrypto from 'string-crypto';

const stringToProtect = 'What is the largest (rational) number n such that there are positive integers p, q, r such that 1 - 1/p - 1/q - 1/r = 1/n?';

Expand All @@ -26,7 +26,7 @@ const password = 'Oh-no,not-again';
const {
encryptString,
decryptString,
} = new StringCrypt();
} = new StringCrypto();

let encryptedString = encryptString(topSecret, password);

Expand All @@ -48,7 +48,7 @@ const options = {
const {
encryptString: saferEncrypt,
decryptString: saferDecrypt,
} = new StringCrypt(options);
} = new StringCrypto(options);
```

## Development and build scripts
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "string-crypt",
"name": "string-crypto",
"version": "1.0.0",
"description": "Small and and simple (yet secure) library to encrypt and decrypt strings using PBKDF2 for key derivation and AES (defaulted to 256-bit / SHA512)",
"main": "dist/index.js",
Expand All @@ -9,7 +9,7 @@
"scripts": {
"build": "rollup -c",
"dev": "concurrently \"rollup -cw\" \"nodemon --inspect runkit.js\"",
"postinstall": "yarn link && yarn link string-crypt"
"postinstall": "yarn link && yarn link string-crypto"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^15.0.0",
Expand Down
6 changes: 3 additions & 3 deletions runkit.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var StringCrypt = require('string-crypt');
var StringCrypto = require('string-crypto');

const topSecret = 'What is the largest (rational) number n such that there are positive integers p, q, r such that 1 - 1/p - 1/q - 1/r = 1/n?';

Expand All @@ -7,7 +7,7 @@ const password = 'Oh-no,not-again';
const {
encryptString,
decryptString,
} = new StringCrypt();
} = new StringCrypto();

let encryptedString = encryptString(topSecret, password);

Expand All @@ -18,7 +18,7 @@ console.log('Decrypted String:', decryptString(encryptedString, password));
const {
encryptString: saferEncrypt,
decryptString: saferDecrypt,
} = new StringCrypt({
} = new StringCrypto({
salt: '2f0ijf2039j23r09j2fg45o9ng98um4o',
iterations: 10,
});
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const deriveKey = (
return pbkdf2Sync(password, salt, iterations, keylen, digest);
};

class StringCrypt {
class StringCrypto {
private _deriveKeyOptions: DeriveKeyOpts;

constructor(options?: DeriveKeyOpts) {
Expand Down Expand Up @@ -118,4 +118,4 @@ class StringCrypt {
};
}

export default StringCrypt;
export default StringCrypto;

0 comments on commit 369f9f7

Please sign in to comment.