npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@inkris-apps/inkripto

v1.0.26

Published

InkriptoGuard encryption library

Readme

InkriptGuard

InkriptGuard is an encryption library that utilizes AES-256-GCM for secure data encryption and decryption. It supports both binary and textual data, with preprocessing and reverse preprocessing for text data to add an extra layer of security. The library is designed for server-side use and requires no external dependencies, making it lightweight and easy to integrate.

Note: This library is intended for server-side use due to its reliance on the fs module for file system operations.

Use Cases

  • Secure Data Transmission: Encrypt sensitive data before sending it over the network.
  • Data Storage: Encrypt data before saving it to disk to prevent unauthorized access.
  • File Encryption: Securely encrypt files for safe storage and transmission.
  • Object Encryption: Encrypt complex objects, ensuring all fields are secure.

Why InkriptGuard?

  • AES-256-GCM Encryption: Provides robust security with authenticated encryption.
  • 0 Dependencies: Lightweight and fast with no external dependencies.
  • Flexible Data Handling: Encrypts and decrypts strings, numbers, objects, arrays, and files.
  • Preprocessing for Extra Security: Adds an additional layer of security by compressing and transforming text data.
  • Beginner Friendly: Easy to use with clear documentation and examples.

Installation

You can install the package via npm or yarn.

Using npm

npm install @inkris-apps/inkripto

Using yarn

yarn add @inkris-apps/inkripto

Usage

Importing the Library

import InkriptGuard from "@inkris-apps/inkripto";

Basic Usage Example

async function secureDataOperation(data: any) {
  const inkriptGuard = new InkriptGuard();

  // Encrypt the data
  const encryptedData = await inkriptGuard.encrypt(data);
  console.log('Encrypted Data:', encryptedData);

  // Decrypt the data
  const decryptedData = await inkriptGuard.decrypt(encryptedData);
  console.log('Decrypted Data:', decryptedData);

  return decryptedData;
}

// Example usage
const sensitiveData = { accountNumber: '1234567890', balance: 1000 };

secureDataOperation(sensitiveData)
  .then((result) => {
    console.log('Operation Result:', result);
  })
  .catch((error) => {
    console.error('Error in secure data operation:', error);
  });

Encryption Examples

Encrypting Strings

const guard = new InkriptGuard();

(async () => {
  const data = "Hello, World!";
  const encryptedData = await guard.encrypt(data);
  console.log("Encrypted Data:", encryptedData);
})();

Encrypting Objects

const data = {
  name: "Alice",
  age: 30,
  address: {
    street: "123 Main St",
    city: "Wonderland"
  }
};

(async () => {
  const encryptedObject = await guard.encrypt(data);
  console.log("Encrypted Object:", encryptedObject);
})();

Encrypting Files

const filePath = "/path/to/your/file.txt";

(async () => {
  const encryptedFile = await guard.encrypt(filePath);
  console.log("Encrypted File:", encryptedFile);
})();

Decryption Examples

Decrypting Strings

const guard = new InkriptGuard();

(async () => {
  const encryptedData = {
    encryptedData: "BASE64_ENCRYPTED_DATA",
    authTag: "BASE64_AUTH_TAG",
    iv: "BASE64_IV"
  };

  const decryptedData = await guard.decrypt(encryptedData);
  console.log("Decrypted Data:", decryptedData);
})();

Decrypting Objects

const encryptedObject = {
  name: {
    encryptedData: "BASE64_ENCRYPTED_DATA",
    authTag: "BASE64_AUTH_TAG",
    iv: "BASE64_IV"
  },
  age: {
    encryptedData: "BASE64_ENCRYPTED_DATA",
    authTag: "BASE64_AUTH_TAG",
    iv: "BASE64_IV"
  }
};

(async () => {
  const decryptedObject = await guard.decrypt(encryptedObject);
  console.log("Decrypted Object:", decryptedObject);
})();

Decrypting Files

const encryptedFile = {
  encryptedData: "BASE64_ENCRYPTED_FILE_DATA",
  authTag: "BASE64_AUTH_TAG",
  iv: "BASE64_IV",
  isBinary: true
};

(async () => {
  const decryptedFile = await guard.decrypt(encryptedFile);
  console.log("Decrypted File:", decryptedFile.toString());
})();

License

This project is licensed under the MIT License.

Contributing

Feel free to contribute to the project by opening issues or submitting pull requests. For major changes, please open an issue first to discuss what you would like to change.

Issues

If you encounter any issues, please create an issue on the GitHub repository.

Repository

You can find the source code at GitHub Repository.

Author

Created by Prince Brown. iWebDevelop.

For more information, visit our website: Inkris.