Skip to main content
Cryptographic Utilities

Explore the cryptographic utility steps in Torq.

Updated over 2 months ago

Use these steps to calculate and generate hashes and UUIDs. See below for examples of each step's input and output.

Calculate MD5

Calculates the MD5 hash of a given file.

Input

sample_file.pdf

Output

f30dcb085daa4e547fa8df4f9f34b1b4


Calculate SHA1

Calculates the SHA1 hash of a given file.

Input

sample_file.pdf

Output

6391b087b4d715fb6a3765ba4a975caa766027e6


Calculate SHA256

Calculates the SHA-256 hash of a given file.

Input

sample_file.pdf

Output

58733067557874c74b264e8de156b4953a185825419a484aab817cdc71d0a162


Decode JWT

Decodes a given JSON Web Token without its signature.

Input

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkphbmUgRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

Output

{
"alg": "HS256",
"typ": "JWT"
}
{
"sub": "1234567890",
"name": "Jane Doe",
"iat": 1516239022
}

Encode JWT

Encodes a JSON Web Token using HS256. Default claims are issue time and expiration time.

Input

{
"alg": "HS256",
"typ": "JWT"
{
"sub": "1234567890",
"name": "John Doe",
"iat": 1615159812
}

}

Output

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTYxNTE1OTgxMn0.<Signature>

Generate HMAC

Generates an HMAC signature for a given message and key.

HMAC Key

{{ $.secrets.jwt_secret }}

Message body

Body


Generate random number

Generates random numbers between the MIN_VALUE (inclusive) and MAXVALUE (exclusive). This can include negative numbers if the MIN_VALUE is below zero.

Min_Value

-50

Max_Value

50

Output

-32


Generate random string

Generates a random string of characters per what you define in the Length field. The string can contain numbers 0-9 and uppercase and lowercase letters.

Length

12

Output

iRT4T2EayYe5


Generate UUID

Generates a string serving as a universally unique identifier.

Output

05581d99-b768-41c8-82f3-7527709836f1


Get TLS Certificate information

Returns the information about TLS/SSL certificates from the given endpoint.

Did this answer your question?