Skip to content

antiganehq/encryption

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Antigane Encryption

A TypeScript implementation of Lattice-based Cryptography for secure message encryption and decryption.

Installation

Install @antigane/encryption with npm

  npm install @antigane/encryption

Usage

1. Import Package

import { createEncryptionService } from "@antigane/encryption";

2. Create Instance Encryption

const encryptionService = createEncryptionService();
  • m : total field Matrics (default. 128)
  • n : total column Matrics (default. 64)
  • q : Mod for math operation (default. 2053)

3. Encryption

const encryptedData = await encryptionService.encrypt(
  "Hello, World!",
  "password"
);
console.log("Encrypted Data:", encryptedData.data);

4. Decryption

const decryptedMessage = await encryptionService.decrypt(
  encryptedData,
  "password"
);
console.log("Decrypted Message:", decryptedMessage);

Example

import { createEncryptionService } from "@antigane/encryption";

async function main() {
  const encryptionService = createEncryptionService();

  // Enkripsi pesan
  const encryptedData = await encryptionService.encrypt(
    "Hello, World!",
    "password"
  );
  console.log("Encrypted Data:", encryptedData.data);

  // Dekripsi pesan
  const decryptedMessage = await encryptionService.decrypt(
    encryptedData,
    "password"
  );
  console.log("Decrypted Message:", decryptedMessage);
}

main();

Logo

Authors

About

encryption with Lattice-based Cryptography

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published