0.0.5 • Published 5 months ago

botpacktest v0.0.5

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

BotPackTest

A TypeScript utility package for secure API key encryption and management.

Installation

npm install botpacktest

Usage

import { saveEncryptedApiKey, retriveEncryptedApiKey } from 'botpacktest';

// Encrypt and save an API key
saveEncryptedApiKey('myKeyIdentifier', 'mySecretKey', 'api_key_to_encrypt');

// Retrieve and decrypt an API key
retriveEncryptedApiKey('myKeyIdentifier', 'mySecretKey');

Features

  • Secure API key encryption using XOR cipher
  • Base64 encoding for safe storage
  • TypeScript support with type definitions
  • Simple API for encryption and decryption
  • Built-in error handling

API Reference

saveEncryptedApiKey(keyValue: string, secret: string, apikey: string): void

Encrypts and saves an API key.

Parameters:

  • keyValue (string): Identifier for the API key
  • secret (string): Secret key used for encryption
  • apikey (string): The API key to encrypt

retriveEncryptedApiKey(keyValue: string, secret: string): void

Retrieves and decrypts an API key.

Parameters:

  • keyValue (string): Identifier for the encrypted API key
  • secret (string): Secret key used for decryption (must match encryption key)

Security Note

This package uses XOR cipher with Base64 encoding. While suitable for basic encryption needs, consider using more robust encryption methods for highly sensitive data.

License

MIT

Author

@sam-the-tutor

0.0.5

5 months ago

0.0.4

5 months ago

0.0.3

5 months ago

0.0.2

5 months ago

0.0.1

5 months ago