cryptia
Version:
Cryptia is a simple JavaScript library for encrypting and decrypting text using a basic substitution cipher. It provides an easy-to-use interface for securing text data in client-side applications..
106 lines (74 loc) β’ 2.71 kB
Markdown
# CryptiaJS π
CryptiaJS is a lightweight and secure JavaScript library for encrypting and decrypting text using a substitution cipher. Whether you're safeguarding sensitive data in web applications or adding encryption to your server-side projects, CryptiaJS is designed to be fast, reliable, and easy to use. β‘
Your data stays protectedβas long as you keep your encryption key private.
## π Installation
Install CryptiaJS via npm:
```bash
npm i cryptia
```
Or clone the GitHub repository:
```bash
git clone https://github.com/chukwunonsoprosper/cryptia
cd cryptia
```
## π Usage
To test the library, run:
```bash
npm run test
```
To spin up a customizable workspace, run:
```bash
npm run dev
```
You can also link `workspace.js` to your project directory to integrate CryptiaJS easily.
### Example
```javascript
/**
* Import Cryptia and required dependencies.
*/
import Cryptia from 'cryptia';
import fs from 'fs';
// Initialize Cryptia with custom settings.
const cryptia = Cryptia({
obfuscationLevel: 10,
logging: true,
preserveWhitespace: true
});
/**
* Encrypt and decrypt text with a secure key.
*/
const plainText = 'This is a secret message.π€£π';
const encryptionKey = 'MySecureKey123';
const encryptedResult = cryptia.encrypt(plainText, encryptionKey, result => {
console.log('Encryption callback:', result);
});
console.log('Encrypted Text:', encryptedResult.data);
const decryptedResult = cryptia.decrypt(
encryptedResult.data,
encryptionKey,
result => {
console.log('Decryption callback:', result);
}
);
console.log('Decrypted Text:', decryptedResult.data);
if (plainText === decryptedResult.data) {
console.log('Decryption successful!');
} else {
console.log('Decryption failed!');
}
```
## π₯ Whatβs New in v1.0.6?
- β
Stronger security β Your encrypted data stays safe as long as your encryption key remains private.
- β
Better performance β Optimized for speed and efficiency.
- β
Cleaner code β More maintainable and readable.
- β
Improved documentation β Making integration smoother than ever.
## π License
This project is licensed under the MIT License.
## π¨βπ» Contributors
Builder: Chukwunonso Prosper & contributors.
## π Get Involved!
π Don't forget to star the project on GitHub!
π [GitHub Repository](https://github.com/chukwunonsoprosper/cryptia)
π Read the full guide: [npmjs.com/package/cryptia](https://www.npmjs.com/package/cryptia)
π’ Follow for updates & discussions:
- π¦ Twitter: [ ](https://twitter.com/prospercode)