![]() |
Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
|
Functions | |
| QByteArray | randomBytes (int count) |
| quint64 | randomUInt64 () |
| QString | encryptSecret (const QByteArray &plaintext, const QByteArray &key, const QByteArray &aad={}) |
Seal a secret with AES-256-GCM as "enc1:<b64 nonce>:<b64 ciphertext+tag>". Returns an empty string unless key is a valid 32-byte key and the cipher completes. aad is authenticated but not stored (bind the ciphertext to its context, e.g. the user name it belongs to). | |
| QByteArray | decryptSecret (const QString &sealed, const QByteArray &key, const QByteArray &aad={}) |
| Open a string produced by encryptSecret(). Returns an empty array on any failure: unknown format, malformed base64, wrong key, wrong aad, or tampering. | |
| QByteArray CryptoUtil::decryptSecret | ( | const QString & | sealed, |
| const QByteArray & | key, | ||
| const QByteArray & | aad ) |
Open a string produced by encryptSecret(). Returns an empty array on any failure: unknown format, malformed base64, wrong key, wrong aad, or tampering.
| QString CryptoUtil::encryptSecret | ( | const QByteArray & | plaintext, |
| const QByteArray & | key, | ||
| const QByteArray & | aad ) |
Seal a secret with AES-256-GCM as "enc1:<b64 nonce>:<b64 ciphertext+tag>". Returns an empty string unless key is a valid 32-byte key and the cipher completes. aad is authenticated but not stored (bind the ciphertext to its context, e.g. the user name it belongs to).
| QByteArray CryptoUtil::randomBytes | ( | int | count | ) |
| quint64 CryptoUtil::randomUInt64 | ( | ) |