Skip to content

0x7l/encrypted_porter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ Encrypted Message API (Node.js | AES-256-CBC)

This is a lightweight encryption/decryption REST API built with Node.js using AES-256-CBC encryption.
It’s ideal for learning cryptography basics, red team tooling, or internal message encryption.


πŸ”§ Features

  • AES-256-CBC encryption with random IV
  • Key derivation using crypto.scryptSync
  • Hex-formatted iv:cipher combo output
  • Manual or Express-based server
  • Minimalist, OPSEC-aware design
  • Ready to test with curl

πŸš€ Getting Started

πŸ“ Clone the Repo

git clone https://github.com/YOUR_USERNAME/encrypted-message-api.git
cd encrypted-message-api

πŸ“₯ Install Dependencies

npm install express

    βœ… crypto is a built-in Node.js core module β€” no need to install it separately.

▢️ Run the Server

node server.js

Server will run at http://localhost:3000
πŸ“ File Structure

encrypted-message-api/
β”œβ”€β”€ server.js       # Express or raw HTTP server
└── encryptor.js    # Encryption/decryption logic

πŸ” API Endpoints
➀ /encrypt

Encrypt a plaintext message using a passphrase.
βœ… CURL Example

curl -X POST http://localhost:3000/encrypt \
  -H "Content-Type: application/json" \
  -d '{"message":"Attack at 0400", "key":"0x7l_secret"}'

πŸ” Response:

{
  "encrypted": "ivhex:cipherhex"
}

➀ /decrypt

Decrypt an encrypted message using the same key.
βœ… CURL Example

curl -X POST http://localhost:3000/decrypt \
  -H "Content-Type: application/json" \
  -d '{"encrypted":"ivhex:cipherhex", "key":"0x7l_secret"}'

πŸ” Response:

{
  "decrypted": "Attack at 0400"
}

πŸ› οΈ Parameters
Parameter	Type	Required	Used In	Description
message	string	βœ…	/encrypt	Plaintext message to encrypt
key	string	βœ…	Both	Secret passphrase used for AES key derivation
encrypted	string	βœ…	/decrypt	Hex string of format iv:ciphertext
βš™οΈ Crypto Details

    Algorithm: AES-256-CBC

    Key Derivation: crypto.scryptSync(key, salt, 32)

    IV: 16-byte random buffer per encryption

    Format: iv_hex:ciphertext_hex

🧠 Built By

0x7l

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published