Initial commit

This commit is contained in:
OpenClaw 2026-03-05 21:45:34 +00:00
parent 0bcd5d781c
commit d436382eda
2 changed files with 24 additions and 1 deletions

View file

@ -1,6 +1,6 @@
{
"name": "backend",
"comment": "added by heartbeat"
"comment": "added by heartbeat",
"version": "1.0.0",
"description": "",
"main": "index.js",

View file

@ -0,0 +1,23 @@
import { encryptText, decryptText } from './encryption.js';
const TEST_KEY = 'YixWi1MYh77NMEQYSJZR+2IsVotTGIe+zTBEGEiWUfs='; // 32 bytes base64
process.env.DATA_ENCRYPTION_KEY = TEST_KEY;
const run = async () => {
const plain = 'Hello, World! 123';
const encrypted = encryptText(plain);
const decrypted = decryptText(encrypted);
if (decrypted !== plain) {
console.error('Decryption mismatch:', { plain, decrypted });
process.exit(1);
}
console.log('Encryption tests passed');
};
run().catch((err) => {
console.error('Encryption tests failed:', err.message);
process.exit(1);
});