Data Encryption

Data Encryption

Teaches a coding agent to implement AES, RSA and TLS encryption with sound key management for data at rest and in transit, with Node.js and Python examples.

Skill files6 files

references/

scripts/

SKILL.md99 lines
1
---
2
name: data-encryption
3
description: >
4
Implement strong encryption using AES, RSA, TLS, and proper key management.
5
Use when securing data at rest, in transit, or implementing end-to-end
6
encryption.
7
---
8
9
# Data Encryption
10
11
## Table of Contents
12
13
- [Overview](#overview)
14
- [When to Use](#when-to-use)
15
- [Quick Start](#quick-start)
16
- [Reference Guides](#reference-guides)
17
- [Best Practices](#best-practices)
18
19
## Overview
20
21
Implement robust encryption strategies for protecting sensitive data at rest and in transit using industry-standard cryptographic algorithms and key management practices.
22
23
## When to Use
24
25
- Sensitive data storage
26
- Database encryption
27
- File encryption
28
- Communication security
29
- Compliance requirements (GDPR, HIPAA, PCI-DSS)
30
- Password storage
31
- End-to-end encryption
32
33
## Quick Start
34
35
Minimal working example:
36
37
```javascript
38
// encryption-service.js
39
const crypto = require("crypto");
40
const fs = require("fs").promises;
41
42
class EncryptionService {
43
constructor() {
44
// AES-256-GCM for symmetric encryption
45
this.algorithm = "aes-256-gcm";
46
this.keyLength = 32; // 256 bits
47
this.ivLength = 16; // 128 bits
48
this.saltLength = 64;
49
this.tagLength = 16;
50
}
51
52
/**
53
* Generate a cryptographically secure random key
54
*/
55
generateKey() {
56
return crypto.randomBytes(this.keyLength);
57
}
58
59
/**
60
* Derive a key from a password using PBKDF2
61
*/
62
async deriveKey(password, salt = null) {
63
// ... (see reference guides for full implementation)
64
```
65
66
## Reference Guides
67
68
Detailed implementations in the `references/` directory:
69
70
| Guide | Contents |
71
|---|---|
72
| [Node.js Encryption Library](references/nodejs-encryption-library.md) | Node.js Encryption Library |
73
| [Python Cryptography Implementation](references/python-cryptography-implementation.md) | Python Cryptography Implementation |
74
| [Database Encryption (PostgreSQL)](references/database-encryption-postgresql.md) | Database Encryption (PostgreSQL) |
75
| [TLS/SSL Configuration](references/tlsssl-configuration.md) | TLS/SSL Configuration |
76
77
## Best Practices
78
79
### ✅ DO
80
81
- Use AES-256-GCM for symmetric encryption
82
- Use RSA-4096 or ECC for asymmetric encryption
83
- Implement proper key rotation
84
- Use secure key storage (HSM, KMS)
85
- Salt and hash passwords
86
- Use TLS 1.2+ for transit encryption
87
- Implement key derivation (PBKDF2, Argon2)
88
- Use authenticated encryption
89
90
### ❌ DON'T
91
92
- Roll your own crypto
93
- Store keys in code
94
- Use ECB mode
95
- Use MD5 or SHA1
96
- Reuse IVs/nonces
97
- Use weak key lengths
98
- Skip authentication tags
99

© AJ Geddes · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…