PsaCipherEncrypt

Encrypt a short message with a symmetric cipher. Opcode: 20 (0x0014)

Parameters

NameTypeDescription
key_nameStringName of the key to use for the operation
algCipherA cipher algorithm that is compatible with the type of key
plaintextVector of bytesShort message to encrypt

Results

NameTypeDescription
ciphertextVector of bytesBuffer containing the random IV followed by the encrypted message

Specific response status codes

  • PsaErrorNotPermitted: The key does not have the encrypt flag, or it does not permit the requested algorithm.

Description

This function will encrypt a short message with a random initialisation vector (IV).

Contract

Protobuf

Copyright 2020 Contributors to the Parsec project.