> For the complete documentation index, see [llms.txt](https://docs.plater.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.plater.network/plater-network-documentation/data-security-and-encryption.md).

# Data Security and Encryption

**Merkle Tree Hashing for Data Verification**

A Merkle Tree provides efficient data integrity checks, requiring minimal computation to verify a data segment against a root hash. This allows for rapid verification while keeping data accessible.

```solidity
function verifyCalldata(
    bytes32[] calldata proof,
    bytes32 root,
    bytes32 leaf
) internal pure returns (bool) {
    return processProofCalldata(proof, leaf) == root;
}

function processProofCalldata(
    bytes32[] calldata proof,
    bytes32 leaf
) internal pure returns (bytes32) {
    bytes32 computedHash = leaf;
    for (uint256 i = 0; i < proof.length; i++) {
        computedHash = _hashPair(computedHash, proof[i]);
    }
    return computedHash;
}
```

**SHA3 Hashing for Security**

The **SHA3** cryptographic hash function generates a unique identifier for each transaction, ensuring data uniqueness and security. SHA3 produces a fixed-size output that’s highly sensitive to input changes—any alteration in the data drastically changes the hash, making tampering detectable.

**Mathematical Basis:** *SHA3* produces a fixed-size output:

*H(M)=SHA3(M)*&#x20;

For a message *M*. Minor changes in *M* create distinct hash outputs, maintaining the integrity of each transaction.

```solidity
import sha3 from 'solidity-sha3';

// Example usage
sha3('a'); // Produces unique hash
sha3('0x0a'); // Another unique hash output
```
