Operations (sample payloads)

Main operations
Copy

Cipher IV
Copy

Use crypto Cipher IV to encrypt or decrypt data. This will return a base64 encoded cipher and a utf-8 encoded decipher.

Sample Input

1
{
2
"mode": "create",
3
"algorithm": "aes-256-cbc",
4
"text": "This is a secret message",
5
"IV": "1234567890123456",
6
"hash_secret_key": {
7
"hash": "sha256",
8
"digest": "hex"
9
}
10
}

Sample Output

1
{
2
"result": "U2FsdGVkX1+RZnZvbGxlciBUZXh0IGhpZXIgZWluZ2ViZW4="
3
}

Hash
Copy

Hash a text in a specified format.

Sample Input

1
{
2
"hash": "sha256",
3
"value": "Hello, World!",
4
"digest": "hex"
5
}

Sample Output

1
{
2
"result": "dffd6021bb2bd5b0af676290809ec3a53191dd81c7f70a4b28688a362182986f"
3
}

Hmac
Copy

Hmac a text in a specified format.

Sample Input

1
{
2
"hash": "sha256",
3
"value": "Hello, World!",
4
"digest": "hex",
5
"secret": "mySecretKey123"
6
}

Sample Output

1
{
2
"result": "4794aec170a54d8855ec9506c91567e2067d72f3b3e19b069632e2bb0d41b6a7"
3
}

Private encrypt
Copy

Encrypt a value using a private RSA key.

Sample Input

1
{
2
"value": "This is a secret message"
3
}

Sample Output

1
{
2
"result": "A1B2C3D4E5F6G7H8I9J0K1L2M3N4O5P6Q7R8S9T0U1V2W3X4Y5Z6a7b8c9d0e1f2g3h4i5j6k7l8m9n0o1p2q3r4s5t6u7v8w9x0y1z2"
3
}

Public decrypt
Copy

Decrypt a value using a public RSA key.

Sample Input

1
{
2
"value": "EncryptedBase64String==",
3
"key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu8LW...\n-----END PUBLIC KEY-----",
4
"passphrase": "optional_passphrase"
5
}

Sample Output

1
{
2
"result": "DecryptedMessage"
3
}

Sign
Copy

Sign a string using a private key.

Sample Input

1
{
2
"value": "Hello, World!",
3
"algorithm": "RSA-SHA256",
4
"output_encoding": "base64"
5
}

Sample Output

1
{
2
"result": "ZX5aKww0xjbClmhnfY6HMhkQeOz7Qai7vSF6defG1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
3
}

Verify
Copy

Verify the given signature for data using the given key and algorithm.

Sample Input

1
{
2
"algorithm": "RSA-SHA256",
3
"value": "Hello, World!",
4
"key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvlFHNDHrcS6jYH9Qb6xP\nZOxzHKVAOtIjcIHjHVN5eAKzHnM/U3ZBs8uI4XplVjJv7j6nQhGx5XuJVQmOQnTr\n8JXHx7I2KTFNpJWVUeG8XZ9JTHHYXiPgRa1gyuVbTWOeoIHbLXvDjV4q8nCQ7tT3\nD0VZOJo4kt4UWWbGjUbvzEXNOHtOQg9QEij39stZRkWVLbLQP7ZMJx7J3cB6Bt8+\nBXJ5jG9yII6Qy6lP9qBQZKWxUdc5yy0to1Q3Fl+uZRIhKTJKTQHIHtXGcD+ZGX9q\n+yV0T01HZwYnNvHbKRWNEV1vULK3xBeRxc/j51PgfPY5GBPHUwG53rGHtRGY5qkp\nKQIDAQAB\n-----END PUBLIC KEY-----",
5
"signature": "ZOyIygCyaOW6Gj2aXvywwhGEO7OpzPFjXuVuIpRXi9+B+ffqYvoPo6PnMF4I3y9DjqCl3xIPGRuPhbIlPaMkOA0Oq0Q7xNUEFbz1VYIu1POrCOiqxWgg5R1VOoQZ7oqq3w8kXD/ETh6Z2nyKshaDVbYAXdHdNFWHHYzRpfwBCXI=",
6
"signature_encoding": "base64"
7
}

Sample Output

1
{
2
"result": true
3
}

Verify JWT signature
Copy

Verify JWT signature using a public key.

Sample Input

1
{
2
"jwt": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCJleHAiOjE1MTYyMzk5MjJ9.NHVaYe26MbtOYhSKkoKYdFVomg4i8ZJd8_-RU8VNbftc4TSMb4bXP3l3YlNWACwyXPGffz5aXHc6lty1Y2t4SWRqGteragsVdZufDn5BlnJl9pdR_kdVFUsra2rWKEofkZeIC4yWytE58sMIihvo9H1ScmmVwBcQP6XETqYd0aSHp1gOa9RdUPDvoXQ5oqygTqVtxaDr6wUFKrKItgBMzWIdNZ6y7O9E0DhEPTbE9rfBo6KTFsHAZnMg4k68CDp2woYIaXbmYTWcvbzIuHO7_37GT79XdIwkm95QJ7hYC9RiwrV7mesbY4PAahERJawntho0my942XheVLmGwLMBkQ",
3
"key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu1SU1LfVLPHCozMxH2Mo\n4lgOEePzNm0tRgeLezV6ffAt0gunVTLw7onLRnrq0/IzW7yWR7QkrmBL7jTKEn5u\n+qKhbwKfBstIs+bMY2Zkp18gnTxKLxoS2tFczGkPLPgizskuemMghRniWaoLcyeh\nkd3qqGElvW/VDL5AaWTg0nLVkjRo9z+40RQzuVaE8AkAFmxZzow3x+VJYKdjykkJ\n0iT9wCS0DRTXu269V264Vf/3jvredZiKRkgwlL9xNAwxXFg0x/XFw005UWVRIkdg\ncKWTjpBP2dPwVZ4WWC+9aGVd+Gyn1o0CLelf4rEjGoXbAAEgAqeGUxrcIlbjXfbc\nmwIDAQAB\n-----END PUBLIC KEY-----",
4
"algorithm": "RSA-SHA256"
5
}

Sample Output

1
{
2
"result": {
3
"verified": true,
4
"header": {
5
"alg": "RS256",
6
"typ": "JWT"
7
},
8
"payload": {
9
"sub": "1234567890",
10
"name": "John Doe",
11
"iat": 1516239022,
12
"exp": 1516239922
13
}
14
}
15
}