Fula Security Layer (FSL)
Fula Security Layer Includes Data Authentication, Decentralized Identity and Encryption.
Fula-sec providing two different way encryption methods.
- Tagged Encryption.(Tagged DID)
- Asymmetric Encryption.
Installation
Install NPM package
npm install @functionland/fula-sec --save
(back to top)
Decentralized Identity (DID)
import {FullaDID} from '@functionland/fula-sec'
const fullaDID = new FullaDID();
await fullaDID.create();
await fullaDID.importMnemonic(result.mnemonic);
await fullaDID.importPrivateKey(result.privateKey);
(back to top)
Tagged Encryption (Tagged DID)
import {FullaDID, TaggedEncryption} from '@functionland/fula-sec'
const AliceDID = new FullaDID();
await AliceDID.create();
const taggedA = new TaggedEncryption(AliceDID.did);
const BobDID = new FullaDID();
await BobDID.create();
const taggedB = new TaggedEncryption(BobDID.did);
let plaintext = {
symetricKey: 'content-privateKey',
CID: 'Content ID'
}
let jwe = await taggedA.encrypt(plaintext.symetricKey, plaintext.CID, [BobDID.did.id])
let dec = await taggedB.decrypt(jwe)
(back to top)
Asymmetric Encryption
import {FullaDID, AsymEncryption} from '@functionland/fula-sec'
const AliceDID = new FullaDID();
await AliceDID.create();
const asymEncA = new AsymEncryption(AliceDID.privateKey);
const BliceDID = new FullaDID();
await BliceDID.create();
const asymEncB = new AsymEncryption(BliceDID.privateKey);
let plaintext = {
symetricKey: 'content-privateKey',
CID: 'Content ID'
}
let jweCipher = await asymEncA.encrypt(plaintext.symetricKey, plaintext.CID, [asymEncB.publicKey]);
let decrypted = await asymEncB.decrypt(jweCipher);
(back to top)
Document Page
Run doc cmd
npx typedoc --out docs
Fulla Sec DOC
Roadmap
See the open issues for a full list of proposed features (and known issues).
(back to top)
Development
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
(back to top)
Maintainers
License
See LICENSE
for more information.
(back to top)