WHY2/README.md

44 lines
1.5 KiB
Markdown
Raw Normal View History

2022-03-09 19:11:08 +01:00
# WHY2 Encryption System
*Yeah.*
### Table of contents
- [Using in Your projects](#using-in-your-projects)
- [Example of code](#example-of-code)
- [Example programs](#example-programs)
## Using in Your projects
2022-03-20 16:28:59 +01:00
To **encrypt** text, use function `encrypt()` from file `./index.js`.
2022-03-09 19:11:08 +01:00
2022-03-20 16:28:59 +01:00
To **decrypt** text, use function `decrypt()` from file `./index.js`.
2022-03-09 19:11:08 +01:00
2022-03-20 16:28:59 +01:00
~~Jump to [examples](#examples) if you're not sure, how to use.~~
2022-03-09 19:11:08 +01:00
## Example of code
- Encryption:
2022-03-20 16:28:59 +01:00
```js
2022-03-20 17:31:40 +01:00
const { encrypt, decrypt } = require("why2-encryption-system.js");
2022-03-09 19:11:08 +01:00
//FIRST VARIANT
2022-03-20 16:28:59 +01:00
var yourText = encryptText("Put here text, you want encrypt...", "tzXlZGxkhfYOvRthqokDrmGFyDMylgmeIlrJTpVAwuqrLjABXM"); //The second thing is Your **key**. (The key must be atleast 50 characters long!)
2022-03-09 19:11:08 +01:00
//SECOND VARIANT
2022-03-20 16:28:59 +01:00
var yourText = encryptText("Put here text, you want encrypt..."); //See? You don't have to use Your key. Program will automatically generate one for you.
2022-03-09 19:11:08 +01:00
```
2022-03-20 17:32:49 +01:00
**WARNING!** The key from encryption will be printed out along the text value as an object \
_Note: exit codes \
`-2` - invalid key \
`0` - operation completed successfully \
2022-03-20 16:28:59 +01:00
`-1` - operation failed, description available using error property_
2022-03-09 19:11:08 +01:00
- Decryption:
2022-03-20 16:28:59 +01:00
```js
char *yourText = decryptText("158.-83.9388.-14.57.8419.113.-98.10576", "tzXlZGxkhfYOvRthqokDrmGFyDMylgmeIlrJTpVAwuqrLjABXM"); //First parameter is Your encrypted text, the second is key you want to use for decryption.
2022-03-09 19:11:08 +01:00
```
## Example programs
2022-03-20 16:28:59 +01:00
Uhm... There aren't any examples (for now)... I will maybe create some... Later...