| Author
|
|
| Version
|
1.0
|
| Category
|
Comms: Networking
|
Hydro Encryption component
A cipher suite to enable encryption and decryption of data messages, based on libhydrogen.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_libhydrogen.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_libhydrogen.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
|
sign_create
|
| Computes a signature for a message using the secret key. Returns 0 if successful.
|
- BYTE
|
signature
|
| Buffer to receive the signature. Must be 64 bytes.
|
- BYTE
|
message
|
| Buffer containing the data to sign
|
- UINT
|
message_size
|
| Byte count of the message
|
- BYTE
|
secret_key
|
| Secret/Private key to be used.Size is 64 bytes.
|
- INT
|
Return
|
|
secretbox_keygen
|
| Creates a secret key suitable for use with the secretbox functions. You must provide a 32 byte array for the key.
|
- BYTE
|
key
|
|
|
- VOID
|
Return
|
|
hash_with_key
|
| Creates a hash fingerprint of the data, using the given key. Returns 0 if successful.
|
- BYTE
|
hash
|
| Buffer for the hash. Size >=32 makes it practically impossible for two messages to produce the same fingerprint.
|
- BYTE
|
data
|
| The data buffer to be processed
|
- UINT
|
size
|
| Byte count of the data to be processed
|
- BYTE
|
key
|
| Key to be used
|
- INT
|
Return
|
|
sign_verify
|
| Verify the signature of a mesasge using the public key. Returns 0 if successful.
|
- BYTE
|
signature
|
| Buffer to receive the signature. Must be 64 bytes.
|
- BYTE
|
message
|
| Buffer containing the data to sign
|
- UINT
|
message_size
|
| Byte count of the message
|
- BYTE
|
public_key
|
| Public key to be used.Size is 32 bytes.
|
- INT
|
Return
|
|
init
|
| Initialisation function. To be called at the very start of your program.
|
- INT
|
Return
|
|
sign_keygen
|
| Creates Private and Public key pair to sign and verify messages. Returns 0 if successful.
|
- BYTE
|
Secret
|
| Buffer to receive the Private/Secret Key. Buffer size must be 64 bytes
|
- BYTE
|
Public
|
| Buffer to receive the Public key. Buffer size must be 32 bytes
|
- INT
|
Return
|
|
secretbox_encrypt
|
| Encrypts a message with a secret key. A single key is used both to encrypt/sign and verify/decrypt messages. For this reason, it is critical to keep the key confidential. Returns 0 on success.
|
- BYTE
|
message
|
| Buffer containing the message to be encrypted.
|
- UINT
|
length
|
| The length (byte count) of the message
|
- UINT
|
ID
|
| Message ID. Can be 0
|
- BYTE
|
key
|
| The secret key
|
- BYTE
|
ciphertext
|
| Buffer for ciphertext output. Buffer size must be at least length + 36
|
- INT
|
Return
|
|
hash_keygen
|
| Creates a secret key suitable for use with the hash_hash function. You must provide a 32 byte array for the key.
|
- BYTE
|
key
|
|
|
- VOID
|
Return
|
|
secretbox_decrypt
|
| Decrypts a message with a secret key. A single key is used both to encrypt/sign and verify/decrypt messages. For this reason, it is critical to keep the key confidential. Returns 0 on success.
|
- BYTE
|
message
|
| Buffer for the decrypted message. Size must be at least length - 36
|
- UINT
|
length
|
| The length (byte count) of the ciphertext
|
- UINT
|
ID
|
| Message ID. Must match with the original message ID. Can be 0
|
- BYTE
|
key
|
| The secret key
|
- BYTE
|
ciphertext
|
| Buffer containing the ciphertext to be decrypted.
|
- INT
|
Return
|
|
hash_without_key
|
| Creates a hash fingerprint of the data, which will always have the same fingerprint, similar to the MD5 or SHA-1 Returns 0 if successful.
|
- BYTE
|
hash
|
| Buffer for the hash. Size >=32 makes it practically impossible for two messages to produce the same fingerprint.
|
- BYTE
|
data
|
| Data buffer to be processed
|
- UINT
|
size
|
| Byte count of data to be processed
|
- INT
|
Return
|
Property reference
|
Properties
|
==Macro reference==
|
sign_create
|
| Computes a signature for a message using the secret key. Returns 0 if successful.
|
- BYTE
|
signature
|
| Buffer to receive the signature. Must be 64 bytes.
|
- BYTE
|
message
|
| Buffer containing the data to sign
|
- UINT
|
message_size
|
| Byte count of the message
|
- BYTE
|
secret_key
|
| Secret/Private key to be used.Size is 64 bytes.
|
- INT
|
Return
|
|
secretbox_keygen
|
| Creates a secret key suitable for use with the secretbox functions. You must provide a 32 byte array for the key.
|
- BYTE
|
key
|
|
|
- VOID
|
Return
|
|
hash_with_key
|
| Creates a hash fingerprint of the data, using the given key. Returns 0 if successful.
|
- BYTE
|
hash
|
| Buffer for the hash. Size >=32 makes it practically impossible for two messages to produce the same fingerprint.
|
- BYTE
|
data
|
| The data buffer to be processed
|
- UINT
|
size
|
| Byte count of the data to be processed
|
- BYTE
|
key
|
| Key to be used
|
- INT
|
Return
|
|
sign_verify
|
| Verify the signature of a mesasge using the public key. Returns 0 if successful.
|
- BYTE
|
signature
|
| Buffer to receive the signature. Must be 64 bytes.
|
- BYTE
|
message
|
| Buffer containing the data to sign
|
- UINT
|
message_size
|
| Byte count of the message
|
- BYTE
|
public_key
|
| Public key to be used.Size is 32 bytes.
|
- INT
|
Return
|
|
init
|
| Initialisation function. To be called at the very start of your program.
|
- INT
|
Return
|
|
sign_keygen
|
| Creates Private and Public key pair to sign and verify messages. Returns 0 if successful.
|
- BYTE
|
Secret
|
| Buffer to receive the Private/Secret Key. Buffer size must be 64 bytes
|
- BYTE
|
Public
|
| Buffer to receive the Public key. Buffer size must be 32 bytes
|
- INT
|
Return
|
|
secretbox_encrypt
|
| Encrypts a message with a secret key. A single key is used both to encrypt/sign and verify/decrypt messages. For this reason, it is critical to keep the key confidential. Returns 0 on success.
|
- BYTE
|
message
|
| Buffer containing the message to be encrypted.
|
- UINT
|
length
|
| The length (byte count) of the message
|
- UINT
|
ID
|
| Message ID. Can be 0
|
- BYTE
|
key
|
| The secret key
|
- BYTE
|
ciphertext
|
| Buffer for ciphertext output. Buffer size must be at least length + 36
|
- INT
|
Return
|
|
hash_keygen
|
| Creates a secret key suitable for use with the hash_hash function. You must provide a 32 byte array for the key.
|
- BYTE
|
key
|
|
|
- VOID
|
Return
|
|
secretbox_decrypt
|
| Decrypts a message with a secret key. A single key is used both to encrypt/sign and verify/decrypt messages. For this reason, it is critical to keep the key confidential. Returns 0 on success.
|
- BYTE
|
message
|
| Buffer for the decrypted message. Size must be at least length - 36
|
- UINT
|
length
|
| The length (byte count) of the ciphertext
|
- UINT
|
ID
|
| Message ID. Must match with the original message ID. Can be 0
|
- BYTE
|
key
|
| The secret key
|
- BYTE
|
ciphertext
|
| Buffer containing the ciphertext to be decrypted.
|
- INT
|
Return
|
|
hash_without_key
|
| Creates a hash fingerprint of the data, which will always have the same fingerprint, similar to the MD5 or SHA-1 Returns 0 if successful.
|
- BYTE
|
hash
|
| Buffer for the hash. Size >=32 makes it practically impossible for two messages to produce the same fingerprint.
|
- BYTE
|
data
|
| Data buffer to be processed
|
- UINT
|
size
|
| Byte count of data to be processed
|
- INT
|
Return
|
Property reference
|
Properties
|
==Macro reference==
|
sign_create
|
| Computes a signature for a message using the secret key. Returns 0 if successful.
|
- BYTE
|
signature
|
| Buffer to receive the signature. Must be 64 bytes.
|
- BYTE
|
message
|
| Buffer containing the data to sign
|
- UINT
|
message_size
|
| Byte count of the message
|
- BYTE
|
secret_key
|
| Secret/Private key to be used.Size is 64 bytes.
|
- INT
|
Return
|
|
secretbox_keygen
|
| Creates a secret key suitable for use with the secretbox functions. You must provide a 32 byte array for the key.
|
- BYTE
|
key
|
|
|
- VOID
|
Return
|
|
hash_with_key
|
| Creates a hash fingerprint of the data, using the given key. Returns 0 if successful.
|
- BYTE
|
hash
|
| Buffer for the hash. Size >=32 makes it practically impossible for two messages to produce the same fingerprint.
|
- BYTE
|
data
|
| The data buffer to be processed
|
- UINT
|
size
|
| Byte count of the data to be processed
|
- BYTE
|
key
|
| Key to be used
|
- INT
|
Return
|
|
sign_verify
|
| Verify the signature of a mesasge using the public key. Returns 0 if successful.
|
- BYTE
|
signature
|
| Buffer to receive the signature. Must be 64 bytes.
|
- BYTE
|
message
|
| Buffer containing the data to sign
|
- UINT
|
message_size
|
| Byte count of the message
|
- BYTE
|
public_key
|
| Public key to be used.Size is 32 bytes.
|
- INT
|
Return
|
|
init
|
| Initialisation function. To be called at the very start of your program.
|
- INT
|
Return
|
|
sign_keygen
|
| Creates Private and Public key pair to sign and verify messages. Returns 0 if successful.
|
- BYTE
|
Secret
|
| Buffer to receive the Private/Secret Key. Buffer size must be 64 bytes
|
- BYTE
|
Public
|
| Buffer to receive the Public key. Buffer size must be 32 bytes
|
- INT
|
Return
|
|
secretbox_encrypt
|
| Encrypts a message with a secret key. A single key is used both to encrypt/sign and verify/decrypt messages. For this reason, it is critical to keep the key confidential. Returns 0 on success.
|
- BYTE
|
message
|
| Buffer containing the message to be encrypted.
|
- UINT
|
length
|
| The length (byte count) of the message
|
- UINT
|
ID
|
| Message ID. Can be 0
|
- BYTE
|
key
|
| The secret key
|
- BYTE
|
ciphertext
|
| Buffer for ciphertext output. Buffer size must be at least length + 36
|
- INT
|
Return
|
|
hash_keygen
|
| Creates a secret key suitable for use with the hash_hash function. You must provide a 32 byte array for the key.
|
- BYTE
|
key
|
|
|
- VOID
|
Return
|
|
secretbox_decrypt
|
| Decrypts a message with a secret key. A single key is used both to encrypt/sign and verify/decrypt messages. For this reason, it is critical to keep the key confidential. Returns 0 on success.
|
- BYTE
|
message
|
| Buffer for the decrypted message. Size must be at least length - 36
|
- UINT
|
length
|
| The length (byte count) of the ciphertext
|
- UINT
|
ID
|
| Message ID. Must match with the original message ID. Can be 0
|
- BYTE
|
key
|
| The secret key
|
- BYTE
|
ciphertext
|
| Buffer containing the ciphertext to be decrypted.
|
- INT
|
Return
|
|
hash_without_key
|
| Creates a hash fingerprint of the data, which will always have the same fingerprint, similar to the MD5 or SHA-1 Returns 0 if successful.
|
- BYTE
|
hash
|
| Buffer for the hash. Size >=32 makes it practically impossible for two messages to produce the same fingerprint.
|
- BYTE
|
data
|
| Data buffer to be processed
|
- UINT
|
size
|
| Byte count of data to be processed
|
- INT
|
Return
|
Property reference
|
Properties
|
==Macro reference==
|
sign_create
|
| Computes a signature for a message using the secret key. Returns 0 if successful.
|
- BYTE
|
signature
|
| Buffer to receive the signature. Must be 64 bytes.
|
- BYTE
|
message
|
| Buffer containing the data to sign
|
- UINT
|
message_size
|
| Byte count of the message
|
- BYTE
|
secret_key
|
| Secret/Private key to be used.Size is 64 bytes.
|
- INT
|
Return
|
|
secretbox_keygen
|
| Creates a secret key suitable for use with the secretbox functions. You must provide a 32 byte array for the key.
|
- BYTE
|
key
|
|
|
- VOID
|
Return
|
|
hash_with_key
|
| Creates a hash fingerprint of the data, using the given key. Returns 0 if successful.
|
- BYTE
|
hash
|
| Buffer for the hash. Size >=32 makes it practically impossible for two messages to produce the same fingerprint.
|
- BYTE
|
data
|
| The data buffer to be processed
|
- UINT
|
size
|
| Byte count of the data to be processed
|
- BYTE
|
key
|
| Key to be used
|
- INT
|
Return
|
|
sign_verify
|
| Verify the signature of a mesasge using the public key. Returns 0 if successful.
|
- BYTE
|
signature
|
| Buffer to receive the signature. Must be 64 bytes.
|
- BYTE
|
message
|
| Buffer containing the data to sign
|
- UINT
|
message_size
|
| Byte count of the message
|
- BYTE
|
public_key
|
| Public key to be used.Size is 32 bytes.
|
- INT
|
Return
|
|
init
|
| Initialisation function. To be called at the very start of your program.
|
- INT
|
Return
|
|
sign_keygen
|
| Creates Private and Public key pair to sign and verify messages. Returns 0 if successful.
|
- BYTE
|
Secret
|
| Buffer to receive the Private/Secret Key. Buffer size must be 64 bytes
|
- BYTE
|
Public
|
| Buffer to receive the Public key. Buffer size must be 32 bytes
|
- INT
|
Return
|
|
secretbox_encrypt
|
| Encrypts a message with a secret key. A single key is used both to encrypt/sign and verify/decrypt messages. For this reason, it is critical to keep the key confidential. Returns 0 on success.
|
- BYTE
|
message
|
| Buffer containing the message to be encrypted.
|
- UINT
|
length
|
| The length (byte count) of the message
|
- UINT
|
ID
|
| Message ID. Can be 0
|
- BYTE
|
key
|
| The secret key
|
- BYTE
|
ciphertext
|
| Buffer for ciphertext output. Buffer size must be at least length + 36
|
- INT
|
Return
|
|
hash_keygen
|
| Creates a secret key suitable for use with the hash_hash function. You must provide a 32 byte array for the key.
|
- BYTE
|
key
|
|
|
- VOID
|
Return
|
|
secretbox_decrypt
|
| Decrypts a message with a secret key. A single key is used both to encrypt/sign and verify/decrypt messages. For this reason, it is critical to keep the key confidential. Returns 0 on success.
|
- BYTE
|
message
|
| Buffer for the decrypted message. Size must be at least length - 36
|
- UINT
|
length
|
| The length (byte count) of the ciphertext
|
- UINT
|
ID
|
| Message ID. Must match with the original message ID. Can be 0
|
- BYTE
|
key
|
| The secret key
|
- BYTE
|
ciphertext
|
| Buffer containing the ciphertext to be decrypted.
|
- INT
|
Return
|
|
hash_without_key
|
| Creates a hash fingerprint of the data, which will always have the same fingerprint, similar to the MD5 or SHA-1 Returns 0 if successful.
|
- BYTE
|
hash
|
| Buffer for the hash. Size >=32 makes it practically impossible for two messages to produce the same fingerprint.
|
- BYTE
|
data
|
| Data buffer to be processed
|
- UINT
|
size
|
| Byte count of data to be processed
|
- INT
|
Return
|
Property reference
|
Properties
|