New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

cryptographic-utils

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cryptographic-utils

Cryptographic Utilities is a JavaScript package that provides functionalities for common cryptographic tasks such as hashing, encryption, and decryption.

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Cryptographic Utilities

Cryptographic Utilities is a JavaScript package that provides functionalities for common cryptographic tasks such as hashing, encryption, and decryption.

Installation

To install Cryptographic Utilities, simply run:

npm install cryptographic-utils

Usage

const CryptoUtils = require('cryptographic-utils');

// Hashing
const hashedData = CryptoUtils.hash('Hello, world!');
console.log('Hashed data:', hashedData);

// Encryption
const key = 'mySecretKey';
const encryptedData = CryptoUtils.encrypt('Sensitive information', key);
console.log('Encrypted data:', encryptedData);

// Decryption
const decryptedData = CryptoUtils.decrypt(encryptedData, key);
console.log('Decrypted data:', decryptedData);

API

CryptoUtils.hash(data, algorithm)

Hashes the provided data using the specified algorithm (default is SHA-256) and returns the hashed value as a hexadecimal string.

CryptoUtils.encrypt(data, key, algorithm)

Encrypts the provided data using the specified key and algorithm (default is AES-256-CBC) and returns the encrypted value as a hexadecimal string.

CryptoUtils.decrypt(data, key, algorithm)

Decrypts the provided data using the specified key and algorithm (default is AES-256-CBC) and returns the decrypted value as a string.

License

This project is licensed under the MIT License - see the LICENSE file for details.

FAQs

Package last updated on 17 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts