Skip to content

feat: add AES-256-CBC encryption utility for sensitive data at rest#263

Open
DebasmitaBose0 wants to merge 1 commit into
SRV30:elusocfrom
DebasmitaBose0:issue-251-aes-encryption-helper
Open

feat: add AES-256-CBC encryption utility for sensitive data at rest#263
DebasmitaBose0 wants to merge 1 commit into
SRV30:elusocfrom
DebasmitaBose0:issue-251-aes-encryption-helper

Conversation

@DebasmitaBose0

Copy link
Copy Markdown
Contributor

Closes #251

Description

Creates a reusable server-side encryption/decryption module using standard Node.js native crypto libraries.

Changes

  • server/utils/encryption.js (NEW, +34 lines):
    Uses AES-256-CBC with keys derived from the ENCRYPTION_KEY environment variable.
    Implements a unique 16-byte random IV initialization vector per encryption for semantic security.
    Formats output as iv:hex for secure string storage.

- Create server/utils/encryption.js with encrypt() and decrypt() functions
- Use Node.js built-in crypto module (no extra dependencies)
- Derive 256-bit key from ENCRYPTION_KEY env var (supports raw 32-byte hex or auto-hashes shorter keys)
- Use random 16-byte IV per encryption for semantic security
- Store output as iv:hex format for safe DB/string storage
- Include key generation command in error message for easy setup
@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

@DebasmitaBose0 is attempting to deploy a commit to the srv30's projects Team on Vercel.

A member of the Team first needs to authorize it.

@DebasmitaBose0 DebasmitaBose0 changed the base branch from main to elusoc July 13, 2026 15:46
@SRV30 SRV30 added elusoc Official ELUSOC 2026 contribution issue eligible for leaderboard points. newbie Beginner-friendly issue suitable for first-time contributors. labels Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

elusoc Official ELUSOC 2026 contribution issue eligible for leaderboard points. newbie Beginner-friendly issue suitable for first-time contributors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ELUSoC_2026] Implement AES-256-CBC encryption utility for sensitive data at rest

2 participants