Cryptography & On-Chain

Protect data at rest — and make it immutable.

In-transit protection is inherent in HTTPS/SSL. Cryptography adds at-rest protection: detecting manipulation, encrypting sensitive data, and anchoring high-value records to the blockchain.

AESSHA-512RSAcrypto-jsCardano
At-rest protection

Two use cases.

The platform is non-prescriptive about your scheme, and provides helper methods for storing keys and ciphertext.

Detect manipulation

Hash a record with your private key and store the signature on the record. On retrieval the view-controller checks the hash before using the data.

Protect disclosure

Store your public key in your space and encrypt sensitive data with it. Decrypt locally in JavaScript with the matching private key.

Mechanisms

The building blocks.

The entityOS SDK includes utility functions using the crypto-js library and the AES algorithm within its _util.protect namespace.

Hashing

AES, SHA-256, SHA-512 and MD5 — for signatures and integrity checks.

Public key

RSA for asymmetric signing and key exchange.

Key storage

CORE_PROTECT_KEY stores public keys within your space.

Ciphertext storage

CORE_PROTECT_CIPHERTEXT stores hashes and encrypted data in the context of a record.

Pattern: single-key integrity

Signing a record.

A symmetric (single private key) manipulation-protection pattern with MVC and entityOS.

Generate a key

Generate a private key and store it on the secure local device using the browser localStorage API — not in entityOS, which would reduce the value of the protection.

Create the signature

Retrieve the key and, using selected data-record attributes (typically including modified date), create a SHA-512 hash that acts as a digital signature.

Store the signature

POST the hash to entityOS using CORE_PROTECT_HASH_MANAGE, keeping it in the context of the data via CORE_PROTECT_CIPHERTEXT.

Verify on retrieval

On read, recompute the SHA-512 hash and compare it with the stored signature. If they match, the data is valid and un-manipulated.

If multiple users share the data, distribute the key to each (typically as a PEM file). Never store the private key in entityOS — it reduces the value of the protection.
Off/On-Chain

Immutability for high-value data.

For records that must be immutable — such as a certificate of approval to a standard — the off/on-chain service anchors a hash of the data to the blockchain.

Browser entityOS blockchain INITIALISE Generate key Store key OffOnChainservice Store key High-value data Must be immutable — e.g. a certificate of approval to a standard. USE Get key ·hash data Store data ·store hash OffOnChainservice Store hash

Initialise once: generate and store a key off-chain and on-chain. In use: hash the data, store it off-chain in entityOS, and anchor the hash on-chain for tamper-evidence.

Your keys, your control

Protection at the lowest level.

Cryptography lets each application owner protect against manipulation and disclosure at the lowest level — with keys they hold and control.