Crypto Helper
The Crypto Helper allows you to use cryptographic functions.
The Crypto Helper allows you to use cryptographic functions.
Categories: Helpers
Type: cryptoHelper/v1
Actions
Hash
Name: hash
Computes and returns the hash of the input.
Properties
Name | Label | Type | Description | Required |
---|---|---|---|---|
algorithm | Cryptographic Algorithm | STRING OptionsMD5, SHA-1, SHA-256 | The cryptographic algorithm that will be used to hash the input. | true |
input | Input | STRING | Calculates the hash of the provided input. | true |
Example JSON Structure
Output
Type: STRING
Hmac
Name: hmac
Computes and returns the HMAC of the input.
Properties
Name | Label | Type | Description | Required |
---|---|---|---|---|
algorithm | Cryptographic Algorithm | STRING OptionsHmacMD5, HmacSHA1, HmacSHA256 | The cryptographic algorithm that will be used to hash the input. | true |
input | Input | STRING | Generates a cryptographic HMAC for the provided input. | true |
key | Key | STRING | Key that will be used for the encryption. | true |
Example JSON Structure
Output
Type: STRING
PGP Decrypt
Name: pgpDecrypt
Decrypts PGP encrypted file using private key and passphrase.
Properties
Name | Label | Type | Description | Required |
---|---|---|---|---|
privateKey | Private PGP Key | STRING | Private PGP key that will decrypt the file. Make sure there is a new line after the PGP header. | true |
file | File | FILE_ENTRY | File that will be decrypted. | true |
passphrase | Passphrase | STRING | Passphrase that was used for encryption. | true |
Example JSON Structure
Output
Type: FILE_ENTRY
Properties
Name | Type | Description |
---|---|---|
extension | STRING | |
mimeType | STRING | |
name | STRING | |
url | STRING |
Output Example
PGP Encrypt
Name: pgpEncrypt
Encrypts the file using PGP public key.
Properties
Name | Label | Type | Description | Required |
---|---|---|---|---|
publicKey | Public PGP Key | STRING | Public PGP key of the recipient of the encrypted file. Make sure there is a new line after the PGP header. | true |
file | File | FILE_ENTRY | File that will be encrypted. | true |
Example JSON Structure
Output
Type: FILE_ENTRY
Properties
Name | Type | Description |
---|---|---|
extension | STRING | |
mimeType | STRING | |
name | STRING | |
url | STRING |
Output Example
RSA Decrypt
Name: rsaDecrypt
Decrypts RSA encrypted file using RSA private key.
Properties
Name | Label | Type | Description | Required |
---|---|---|---|---|
privateKey | Private RSA Key | STRING | Private RSA key that will decrypt the file. | true |
file | File | FILE_ENTRY | File that will be decrypted. | true |
Example JSON Structure
Output
Type: FILE_ENTRY
Properties
Name | Type | Description |
---|---|---|
extension | STRING | |
mimeType | STRING | |
name | STRING | |
url | STRING |
Output Example
RSA Encrypt
Name: rsaEncrypt
Encrypts the file using the RSA public key.
Properties
Name | Label | Type | Description | Required |
---|---|---|---|---|
publicKey | Public RSA Key | STRING | Public RSA key of the recipient of the encrypted file. | true |
file | File | FILE_ENTRY | File that will be encrypted. | true |
Example JSON Structure
Output
Type: FILE_ENTRY
Properties
Name | Type | Description |
---|---|---|
extension | STRING | |
mimeType | STRING | |
name | STRING | |
url | STRING |
Output Example
Sign
Name: sign
Cryptographically signs a file.
Properties
Name | Label | Type | Description | Required |
---|---|---|---|---|
privateKey | Private RSA Key | STRING | Private RSA key that will be used to sign the file. | true |
file | File | FILE_ENTRY | File that will be signed | true |
Example JSON Structure
Output
Type: FILE_ENTRY
Properties
Name | Type | Description |
---|---|---|
extension | STRING | |
mimeType | STRING | |
name | STRING | |
url | STRING |
Output Example
Verify
Name: verify
Verify the signature using public RSA key.
Properties
Name | Label | Type | Description | Required |
---|---|---|---|---|
publicKey | Public RSA Key | STRING | Public RSA key that will verify the signature. | true |
file | File | FILE_ENTRY | File whose signature will be verified. | true |
signature | Signature | FILE_ENTRY | Signature that will be verified. | true |
Example JSON Structure
Output
Type: BOOLEAN
Additional instructions
How to generate RSA key pair:
-
Run this command in terminal to create private_key.pem in the working directory: openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:2048
-
Run this command in terminal to extract public key form the private key: openssl rsa -pubout -in private_key.pem -out public_key.pem
-
To read the keys run this in terminal: cat public_key.pem or cat private_key.pem
How to generate PGP key pair:
Run these commands in terminal.
-
sudo apt install gnupg
-
gpg --full-generate-key
-
When prompted write your name, email address, comment and passphrase
-
To get public key run: gpg --armor --export <our_email_address> > public_key.asc
-
To get private key run: gpg --armor --export-secret-key <our_email_address> > private_key.asc