Lgpd Encryption Keys logo

Lgpd Encryption Keys

Community
goul4rt
lgpd-encryption-keys

Configure encryption at rest, in transit, and key management aligned with LGPD Art. 46 (security duty) and the ANPD's Guia de Segurança da Informação para ATPP. Use when user asks 'criptografia LGPD', 'KMS', 'TDE', 'encryption at rest', 'rotação de chaves', 'pgcrypto', 'column-level encryption'. Tailored for Prisma/PostgreSQL/Better Auth stack.

Overview

Publishergoul4rt
Repositorylgpd-skills
Skill namelgpd-encryption-keys
Stars
107
Forks
15
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by goul4rt on GitHub. Read the source before you install it.

Installation

Install the Lgpd Encryption Keys AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/goul4rt/lgpd-skills/tree/main/skills/lgpd-encryption-keys
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/goul4rt/lgpd-skills.git /tmp/lgpd-skills
mkdir -p .claude/skills
cp -r /tmp/lgpd-skills/skills/lgpd-encryption-keys .claude/skills/lgpd-encryption-keys
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Lgpd Encryption Keys in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Lgpd Encryption Keys on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Lgpd Encryption Keys is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Encryption & Key Management

Art. 46 LGPD + Guia de Segurança da Informação para ATPP (ANPD, 2021).

Camadas

1. Em trânsito

  • TLS 1.3 em toda comunicação (cliente ↔ servidor, serviço ↔ serviço)
  • HSTS habilitado (max-age=31536000; includeSubDomains; preload)
  • Certificate pinning em apps mobile (React Native — react-native-ssl-pinning ou equivalente)
  • mTLS para comunicação entre serviços internos quando viável

2. Em repouso

  • TDE (Transparent Data Encryption) no PostgreSQL — habilitado pelo provider (AWS RDS, GCP Cloud SQL)
  • Volume encryption (EBS, persistent disks) — geralmente padrão hoje
  • Backups criptografados — mesma chave do volume, ou KMS dedicado
  • Storage de arquivos (S3, GCS): server-side encryption (SSE-KMS preferível a SSE-S3)

3. Nível de aplicação (campos sensíveis)

Para CPF, biometria, dados de saúde, tokens de auth — criptografia adicional em coluna:

ts
// lib/crypto/field-encryption.ts
import { createCipheriv, createDecipheriv, randomBytes } from "crypto";

const KEY = await loadKeyFromKMS(); // 32 bytes

export function encryptField(plain: string): string {
  const iv = randomBytes(12);
  const cipher = createCipheriv("aes-256-gcm", KEY, iv);
  const enc = Buffer.concat([cipher.update(plain, "utf8"), cipher.final()]);
  const tag = cipher.getAuthTag();
  return Buffer.concat([iv, tag, enc]).toString("base64");
}

export function decryptField(encoded: string): string {
  const buf = Buffer.from(encoded, "base64");
  const iv = buf.subarray(0, 12);
  const tag = buf.subarray(12, 28);
  const enc = buf.subarray(28);
  const decipher = createDecipheriv("aes-256-gcm", KEY, iv);
  decipher.setAuthTag(tag);
  return Buffer.concat([decipher.update(enc), decipher.final()]).toString("utf8");
}

Prisma extension para criptografia transparente:

ts
const prisma = new PrismaClient().$extends({
  query: {
    user: {
      async create({ args, query }) {
        if (args.data.cpf) args.data.cpf = encryptField(args.data.cpf);
        return query(args);
      },
      async findUnique({ args, query }) {
        const r = await query(args);
        if (r?.cpf) r.cpf = decryptField(r.cpf);
        return r;
      }
    }
  }
});

KMS

Use KMS gerenciado (AWS KMS, GCP KMS, Azure Key Vault) ou HashiCorp Vault para chaves de aplicação.

  • Chaves separadas por finalidade (PII identidade vs. PII financeiro vs. PII saúde)
  • Rotação anual no mínimo (data key automática + master key manual)
  • Acesso por IAM com least privilege
  • Log de uso da chave (CloudTrail / equivalente)
  • Backup das chaves (KMS já faz, mas atestar)

Crypto-shredding

Para suportar Art. 18, VI (eliminação):

  • Cada titular tem uma chave de envelope (encrypted by master key)
  • Dados sensíveis cifrados com a chave do titular
  • Eliminação = deletar a chave do titular no KMS
  • Dado em repouso torna-se irrecuperável sem necessidade de varrer 100% do storage

Útil quando há retenção legal de outros campos mas o restante deve ser eliminável.

Better Auth + senhas

Better Auth usa hash padrão (Argon2id ou bcrypt). Configure:

  • Argon2id com memória ≥ 64MB, paralelismo 2, iterações ≥ 3
  • OU bcrypt com cost ≥ 12

Status update

markdown
## F7 — Encryption ✓
- TLS 1.3 + HSTS confirmados
- TDE habilitado no Postgres
- KMS configurado com 3 chaves (identidade, financeiro, saúde)
- Crypto-shredding implementado para campos críticos
- Rotação anual em calendário
- Próximo: lgpd-retention-erasure

Frequently asked questions

What does the Lgpd Encryption Keys AI skill do?

Configure encryption at rest, in transit, and key management aligned with LGPD Art. 46 (security duty) and the ANPD's Guia de Segurança da Informação para ATPP. Use when user asks 'criptografia LGPD', 'KMS', 'TDE', 'encryption at rest', 'rotação de chaves', 'pgcrypto', 'column-level encryption'. Tailored for Prisma/PostgreSQL/Better Auth stack.

Why use Lgpd Encryption Keys on TypingMind?

Because you install it once and use it with any model. Lgpd Encryption Keys is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Lgpd Encryption Keys in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/goul4rt/lgpd-skills/tree/main/skills/lgpd-encryption-keys. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Lgpd Encryption Keys?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Lgpd Encryption Keys?

As many as you like. As long as a model supports skills, you can use Lgpd Encryption Keys with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Lgpd Encryption Keys AI skill free?

Yes. It is published on GitHub by goul4rt under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇