---
title: Randomly Generated IVs And Keys Should Be Used For Crypto Calls
description: "Impact Area Security Severity High Affected Element Apex Class ## Rule ID **SF-0022** ## Impact Hard-wiring cryptographic key values greatly compromises the security of encrypted data. ## Remediation Use random seeds for your cryptographic operations. ### Time to fix 120…"
url: "https://community-staging.qualityclouds.com/qcdocs/qc/pmd-rules/randomly-generated-ivs-and-keys-should-be-used-for-crypto-calls/"
updated: "2025-03-21"
category: PMD Rules
---

# Randomly Generated IVs And Keys Should Be Used For Crypto Calls

Impact Area

Security

Severity

High

           Affected Element

Apex Class

## Rule ID

**SF-0022**

## Impact

Hard-wiring cryptographic key values greatly compromises the security of encrypted data.

## Remediation

Use random seeds for your cryptographic operations.

### Time to fix

120 min

## References

This rule is linked to [Common Weakness Enumeration CWE-311 Missing Encryption of Sensitive Data](https://cwe.mitre.org/data/definitions/311.html).
