GitHub Home

API Documentation

Integrate the SHUBHAMOS encryption engine directly into your applications.

Our completely stateless, serverless API utilizes military-grade AES-256 encryption. We never store your decryption keys or unencrypted data on our servers, ensuring absolute privacy. All endpoints communicate exclusively via standard JSON payloads.

Base URL: https://encryption.shubhamos.com


POST /api/v1/text/encrypt

Encrypt a plain text message.

Request Body

{
  "text": "Your secret message here"
}

Response

{
  "encrypted": "base64_encoded_payload_string",
  "key": "hex_key_string"
}

POST /api/v1/text/decrypt

Decrypt an encrypted text message.

Request Body

{
  "payload": "base64_encoded_payload_string",
  "key": "hex_key_string"
}

Response

{
  "text": "Your secret message here"
}

POST /api/v1/image/encrypt

Encrypt an image. Accepts raw base64 or Data URLs.

Request Body

{
  "image": "base64_encoded_image_string_or_data_url"
}

Response

{
  "encrypted_image": "base64_encoded_encrypted_payload",
  "key": "hex_key_string"
}

POST /api/v1/image/decrypt

Decrypt an encrypted image.

Request Body

{
  "encrypted_image": "base64_encoded_encrypted_payload",
  "key": "hex_key_string"
}

Response

{
  "image": "data:image/png;base64,decrypted_base64_image_string"
}

Python Integration Example

Here is a complete sample showing how to interact with the API using Python's requests library.

import requests

def demo_text_encryption():
    print("--- Text Encryption Demo ---")
    
    # 1. Encrypt Text
    encrypt_url = "https://encryption.shubhamos.com/api/v1/text/encrypt"
    message = "This is a super secret message sent via API!"
    
    response = requests.post(encrypt_url, json={"text": message})
    if response.status_code == 200:
        data = response.json()
        encrypted_payload = data['encrypted']
        key = data['key']
        print(f"Encrypted Payload: {encrypted_payload[:30]}...")
        print(f"Decryption Key: {key}")
        
        # 2. Decrypt Text
        decrypt_url = "https://encryption.shubhamos.com/api/v1/text/decrypt"
        decrypt_response = requests.post(decrypt_url, json={
            "payload": encrypted_payload,
            "key": key
        })
        
        if decrypt_response.status_code == 200:
            decrypted_text = decrypt_response.json()['text']
            print(f"Decrypted Message: {decrypted_text}")

if __name__ == "__main__":
    demo_text_encryption()