Home

There is a newer version of this page. You can find it here.

Download project

Crypto Example

"Crypto Example" shows which cryptographic functions are available in CODESYS and how to use them.

Product description

Cryptographic techniques are important in order to achieve the following objectives when processing data:

  • Integrity of data guarantees that the recipient can be sure that any changes to the data do not go unnoticed.
  • Authenticity means that the recipient can be reasonably sure that a data set has actually been created by its alleged author.
  • Confidentiality aims to prevent unauthorized access to the relevant data under all circumstances.

In CODESYS, the libraries CmpCrypto.library and CmpX509Cert.library are provided for this purpose.
The sample project CryptoDemo.project included in the CODESYS package demonstrates how to use both libraries for different use cases.

More information

This example covers the following topics:

  • Random number generation
  • Hashing
  • Hash-based message authentication code (HMAC)
  • Encryption
    • Symmetric encryption
      • Example: AES-256 in CBC mode
      • Combination of signing and encryption
    • Asymmetric encryption
      • Key pair generation
      • Access to certificates
      • Encryption
      • Decryption
      • Signing of data
      • Validation
  • Pay by use

The functionality of the sample project CryptoDemo.project is described in the document CryptoDemo.pdf.
The project CryptoCertDemo.project shows how a message can be encrypted by a sender and decrypted by a recipient using certificates.
The document is copied to the target directory when the CODESYS package is installed.

Screenshot thumbnail
Screenshot of Visualization