Communitygithub.com

데이터 암호화

데이터 암호화 — 모든 연결에 TLS 적용, PII는 AES-256-GCM으로 암호화, 비밀번호는 bcrypt 사용, 데이터베이스 백업 암호화.

데이터 암호화란 무엇인가요?

이 스킬은 애플리케이션 전반에 걸쳐 강력한 데이터 암호화 규칙을 적용하는 방법을 정의합니다. 모든 HTTP 트래픽을 HTTPS로 리디렉션하고 HSTS 헤더를 설정하여 전송 계층을 보호하며, 데이터베이스에 저장되기 전에 AES-256-GCM을 사용하여 PII(개인 식별 정보)를 애플리케이션 수준에서 암호화합니다. 이메일 주소는 조회를 위해 SHA-256으로 해싱하고, 표시를 위해 AES-256-GCM으로 암호화하여 실제 데이터를 노출하지 않고 검색을 가능하게 합니다. 비밀번호는 bcrypt 또는 argon2id와 같은 안전한 해싱 알고리즘만 사용하며, SHA나 MD5는 절대 사용하지 않습니다. 데이터베이스 백업은 암호화되어 저장되며, 암호화 키는 데이터와 분리된 시크릿 매니저에 안전하게 보관됩니다. Node.js 환경에서는 `node:crypto` 모듈을, 브라우저 환경에서는 `crypto.subtle` API를 사용하는 구체적인 코드 예제를 제공합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/YepAPI/skills/tree/HEAD/skills/data-encryption

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

데이터 암호화은(는) 무엇을 하나요?

규칙

  • 모든 곳에 TLS 적용: HTTP를 HTTPS로 리디렉션, HSTS 헤더 설정, 암호화되지 않은 연결 절대 허용 안 함
  • PII(개인 식별 정보) 칼럼은 데이터베이스에 저장하기 전에 애플리케이션 수준에서 AES-256-GCM으로 암호화
  • 이메일은 조회용으로 SHA-256 해싱, 표시용으로 AES-256-GCM 암호화 — 데이터 노출 없이 검색 가능
  • 비밀번호: bcrypt 또는 argon2id만 사용 — SHA, MD5 또는 복호화 가능한 암호화 절대 사용 금지
  • 데이터베이스 백업 암호화 및 암호화 키는 데이터와 별도로 저장
  • 브라우저 측 암호화는 crypto.subtle 사용, 서버 측은 node:crypto 사용
  • 암호화 키는 시크릿 매니저에 저장, 코드나 암호화된 데이터와 함께 절대 저장 금지
// Node.js AES-256-GCM 암호화/복호화
import { createCipheriv, createDecipheriv, randomBytes } from "node:crypto";

const ENCRYPTION_KEY = Buffer.from(process.env.ENCRYPTION_KEY!, "hex"); // 32바이트

function encrypt(plaintext: string): string {
  const iv = randomBytes(12);
  const cipher = createCipheriv("aes-256-gcm", ENCRYPTION_KEY, iv);
  const encrypted = Buffer.concat([cipher.update(plaintext, "utf8"), cipher.final()]);
  const tag = cipher.getAuthTag();
  return Buffer.concat([iv, tag, encrypted]).toString("base64");
}

function decrypt(ciphertext: string): string {
  const buf = Buffer.from(ciphertext, "base64");
  const iv = buf.subarray(0, 12);
  const tag = buf.subarray(12, 28);
  const encrypted = buf.subarray(28);
  const decipher = createDecipheriv("aes-256-gcm", ENCRYPTION_KEY, iv);
  decipher.setAuthTag(tag);
  return decipher.update(encrypted) + decipher.final("utf8");
}

피해야 할 사항

  • PII를 평문으로 저장 — 데이터베이스 침해 시 모든 정보 노출
  • ECB 모드 또는 인증 없는 AES(CBC with HMAC 없음) 사용 — GCM 사용
  • MD5 또는 SHA로 비밀번호 해싱 — 이들은 비밀번호 해싱 알고리즘이 아님
  • 암호화 키를 소스 코드에 하드코딩 — 환경 변수 또는 KMS 사용
  • 내부 통신이라도 HTTP를 통해 민감 데이터 전송 — 모든 연결에 TLS 사용

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

YepAPI/skills

WCAG 2.1 AA — semantic HTML, keyboard navigation, screen readers.

YepAPI/skills

Experiment setup, variant splitting, statistical significance, and feature flag integration.

YepAPI/skills

CRUD generators, data tables, user management, role-based access, and bulk operations.

YepAPI/skills

Monitor what ChatGPT and Gemini say about your brand using YepAPI.

YepAPI/skills

Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.

YepAPI/skills

Commander.js, interactive prompts with Clack, spinners, colors, config files, exit codes, and npm publishing.

YepAPI/skills

cmdk integration, Cmd+K trigger, fuzzy search, grouped actions, keyboard navigation, and dynamic action registration.

YepAPI/skills

Content planning with trend and sentiment data from YepAPI.

YepAPI/skills

Content calendar, keyword-driven planning, and content briefs.

YepAPI/skills

Theme switching with CSS variables, system preference detection, next-themes, and persistence.

YepAPI/skills

Threaded comments, @mentions, reactions, moderation queue, optimistic UI, and cursor pagination.

YepAPI/skills

Competitive analysis between domains using YepAPI.

YepAPI/skills

Layout grids, KPI cards, data tables with sorting/filtering, sidebar navigation, and responsive breakpoints.

YepAPI/skills

Chart patterns with Recharts/Nivo/D3, responsive containers, color scales, and accessibility.

YepAPI/skills

Drizzle schema definition, push vs migrate, type-safe queries, relations, transactions, and prepared statements.

YepAPI/skills

Upload handling, resize/compress, CDN delivery, blur placeholders, and next/image patterns.

YepAPI/skills

Local business and Google Maps research using YepAPI.

YepAPI/skills

Cursor-based pagination, IntersectionObserver, virtualized lists with @tanstack/react-virtual, and scroll position restoration.

YepAPI/skills

Tenant isolation (row-level vs schema), subdomain routing, per-tenant config, and data partitioning.

YepAPI/skills

Chat UI components, streaming responses with AI SDK, context window management, and RAG patterns.

관련 스킬