BananaCrypt is a revolutionary encryption library inspired by the peeling complexity of bananas. It uses the potassium levels of bananas as the base for its cryptographic algorithms. Perfect for developers who want to keep their secrets safe and fruity.
bash
Copy code
pnpm add banana-crypt
-
apiKey
(string, required)
Your API key to authenticate with BananaCrypt's remote potassium-analysis server. -
options
(object, optional)
Additional configuration options:debug
(boolean, default:false
) - Enables debug logging.region
(string, default:"us-east-1"
) - Specify the region for the potassium server.
typescript
Copy code
import BananaCrypt from 'banana-crypt'; const crypt = new BananaCrypt('your-api-key', { debug: true });
Encrypts a given message using BananaCrypt's proprietary algorithm.
message
(string, required) - The plaintext message to encrypt.
- An encrypted string.
typescript
Copy code
const encrypted = crypt.encrypt('Hello, World!'); console.log(encrypted); // Output: Encrypted gibberish
Decrypts a BananaCrypt-encrypted message.
encryptedMessage
(string, required) - The encrypted message to decrypt.
- The original plaintext message.
typescript
Copy code
const decrypted = crypt.decrypt(encrypted); console.log(decrypted); // Output: Hello, World!
Analyzes a banana's potassium level from an image URL or file path.
banana
(string, required) - The URL or file path to the banana image.
- A potassium level as a number.
typescript
Copy code
const potassium = crypt.analyzeBanana('path/to/banana.jpg'); console.log(`Potassium level: ${potassium}`);
Generates an encryption key based on a given potassium level.
potassiumLevel
(number, required) - The potassium level to generate the key.
- A cryptographic key as a string.
typescript
Copy code
const key = crypt.generateKey(420); console.log(`Generated Key: ${key}`);
Validates whether a given key is valid for use in BananaCrypt.
key
(string, required) - The cryptographic key to validate.
true
if the key is valid,false
otherwise.
typescript
Copy code
const isValid = crypt.isValidKey('some-random-key'); console.log(isValid); // Output: true or false
A "Hello, World!" program using BananaCrypt:
typescript
Copy code
import BananaCrypt from 'banana-crypt'; // Initialize BananaCrypt const crypt = new BananaCrypt('your-api-key', { debug: true }); // Encrypt a message const encrypted = crypt.encrypt('Hello, World!'); console.log('Encrypted:', encrypted); // Decrypt the message const decrypted = crypt.decrypt(encrypted); console.log('Decrypted:', decrypted);
MIT License – because bananas should be free for everyone. 🍌
4o