DEV Community

Cover image for Discover The Encryption & Hashing Utility API
Etuge Anselm for Dakidarts

Posted on

Discover The Encryption & Hashing Utility API

A universal cryptography utility for developers.
Supports hashing, encryption, and decryption with multiple algorithms.
Built for easy GET/POST integration in apps.

Encryption & Hashing Utility API


๐ŸŒ Base URL

encryption-hashing-utility-api.p.rapidapi.com
Enter fullscreen mode Exit fullscreen mode

โšก Endpoint

GET /crypto

POST /crypto

Perform hashing, encryption, or decryption using the specified algorithm.


๐Ÿ“ฅ Query / JSON Body Parameters

Param Type Required Description
text string โœ… Yes Input plain text (for hashing/encryption) or ciphertext (for decryption).
algo string โœ… Yes Algorithm to use. Supported: sha256, sha512, md5, bcrypt, argon2, blake2b, blake2s, aes, rsa, blowfish, chacha20.
action string โŒ No One of: hash (default for hash algos), encrypt, decrypt. Default: encrypt.
key string โš ๏ธ Depends Required for encryption/decryption (aes, rsa, blowfish, chacha20). Not needed for hash.
iv string โš ๏ธ Depends Required (Base64) when decrypting AES or Blowfish.
nonce string โš ๏ธ Depends Required (Base64) when decrypting ChaCha20.

๐Ÿ”‘ Supported Algorithms

Hashing

  • sha256
  • sha512
  • md5
  • bcrypt
  • argon2
  • blake2b
  • blake2s

Encryption / Decryption

  • AES (CBC mode, Base64 encoded ciphertext + IV)
  • RSA (PKCS1_OAEP, PEM keys required)
  • Blowfish (CBC mode, Base64 encoded ciphertext + IV)
  • ChaCha20 (Base64 encoded ciphertext + Nonce)

๐Ÿ“Š Example Requests & Responses

1. Hashing (SHA256)

Request

GET /crypto?text=hello&algo=sha256&action=hash
Enter fullscreen mode Exit fullscreen mode

Response

{
  "algorithm": "sha256",
  "action": "hash",
  "result": "2cf24dba5fb0a30e26e83b2ac5b9e29e..."
}
Enter fullscreen mode Exit fullscreen mode

2. Hashing (Argon2)

Request

POST /crypto
{
  "text": "mypassword",
  "algo": "argon2",
  "action": "hash"
}
Enter fullscreen mode Exit fullscreen mode

Response

{
  "algorithm": "argon2",
  "action": "hash",
  "result": "$argon2id$v=19$m=65536,t=3,p=4$..."
}
Enter fullscreen mode Exit fullscreen mode

3. AES Encrypt

Request

POST /crypto
{
  "text": "secret data",
  "algo": "aes",
  "action": "encrypt",
  "key": "mysecretkey123"
}
Enter fullscreen mode Exit fullscreen mode

Response

{
  "algorithm": "AES",
  "action": "encrypt",
  "result": {
    "ciphertext": "4tD5a8l1oG+Q6...",
    "iv": "jhs78J9n0sdh=="
  }
}
Enter fullscreen mode Exit fullscreen mode

4. AES Decrypt

Request

POST /crypto
{
  "text": "4tD5a8l1oG+Q6...",
  "algo": "aes",
  "action": "decrypt",
  "key": "mysecretkey123",
  "iv": "jhs78J9n0sdh=="
}
Enter fullscreen mode Exit fullscreen mode

Response

{
  "algorithm": "AES",
  "action": "decrypt",
  "result": "secret data"
}
Enter fullscreen mode Exit fullscreen mode

5. RSA Encrypt

Request

POST /crypto
{
  "text": "hidden message",
  "algo": "rsa",
  "action": "encrypt",
  "key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkq...\n-----END PUBLIC KEY-----"
}
Enter fullscreen mode Exit fullscreen mode

Response

{
  "algorithm": "RSA",
  "action": "encrypt",
  "result": "Lk23a9hdJd+Skj2..."
}
Enter fullscreen mode Exit fullscreen mode

6. Blowfish Encrypt

Request

POST /crypto
{
  "text": "legacy data",
  "algo": "blowfish",
  "action": "encrypt",
  "key": "legacyKey"
}
Enter fullscreen mode Exit fullscreen mode

Response

{
  "algorithm": "Blowfish",
  "action": "encrypt",
  "result": {
    "ciphertext": "8shd9sk32==",
    "iv": "9dsh6sdh=="
  }
}
Enter fullscreen mode Exit fullscreen mode

7. ChaCha20 Encrypt

Request

POST /crypto
{
  "text": "fast crypto",
  "algo": "chacha20",
  "action": "encrypt",
  "key": "superstreamkey123"
}
Enter fullscreen mode Exit fullscreen mode

Response

{
  "algorithm": "ChaCha20",
  "action": "encrypt",
  "result": {
    "ciphertext": "ab29dshJDs==",
    "nonce": "2sd8hs72=="
  }
}
Enter fullscreen mode Exit fullscreen mode

โš ๏ธ Error Handling

Examples of possible errors:

Missing Parameters

{
  "error": "Missing required params: text, algo"
}
Enter fullscreen mode Exit fullscreen mode

Unsupported Algorithm

{
  "error": "Unsupported algorithm"
}
Enter fullscreen mode Exit fullscreen mode

Decryption Failure

{
  "error": "RSA decryption failed. Ensure correct private key & ciphertext"
}
Enter fullscreen mode Exit fullscreen mode

๐Ÿ›ก๏ธ Security Notes

  • Always keep keys private & secure.
  • bcrypt and argon2 are best for password storage.
  • RSA requires proper PEM-formatted keys.
  • Never log plaintext or keys in production apps.

Top comments (0)