0.1.5 • Published 10 months ago

@antigane/encryption v0.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

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

0.1.5

10 months ago

0.1.4

10 months ago

0.1.3

10 months ago

0.1.2

10 months ago

0.1.1

10 months ago

0.1.0

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

11 months ago

0.0.2

11 months ago

0.0.1

11 months ago