age

age는 단순한 recipient 기반 파일 암호화 도구이며, sops와 함께 secret 파일의 key backend로 자주 사용된다.

  • 공개키 recipient 또는 passphrase 방식으로 파일을 암호화할 수 있다.
  • SSH public key를 recipient로 직접 쓸 수 있어 진입 장벽이 낮다.
  • 팀 운영에서는 age-keygen으로 identity를 만들고, 공개키만 sops 또는 recipient 파일에 배포하는 패턴이 흔하다.
# Windows
winget install FiloSottile.age
 
# macOS
brew install age
 
# Debian / Ubuntu
apt install age
 
# Fedora / RHEL
dnf install age
  • Windows 패키지 ID는 FiloSottile.age다.
  • Linux는 배포판에 따라 apt 또는 dnf 계열 패키지명 age를 그대로 사용한다.
age-keygen -o key.txt
age -r age1example... -o secret.txt.age secret.txt
age --decrypt -i key.txt -o secret.txt secret.txt.age
  • age –encrypt -r RECIPIENT INPUT
  • age –encrypt –passphrase INPUT
  • age –decrypt -i IDENTITY INPUT
  • age-keygen -o OUTPUT
  • -r, –recipient: 공개키 recipient 지정. 여러 번 반복 가능.
  • -R, –recipients-file: recipient 목록 파일 사용.
  • -i, –identity: 복호화용 secret key 또는 SSH key 파일 지정.
  • -p, –passphrase: 수신자 키 대신 passphrase 기반 암호화.
  • -a, –armor: PEM 형태 ASCII armor 출력.
  • -o, –output: 출력 파일 지정.
  • age-keygen -y: identity 파일에서 공개 recipient를 다시 추출.
  • age-keygen -pq: post-quantum hybrid ML-KEM-768 + X25519 키 생성.
# 새 identity 생성
age-keygen -o key.txt
 
# 공개키 확인
age-keygen -y key.txt
 
# recipient 공개키로 암호화
age -r age1exampleexampleexampleexampleexampleexample -o secret.yaml.age secret.yaml
 
# SSH public key를 recipient로 사용
age -r "$(cat ~/.ssh/id_ed25519.pub)" -o backup.tar.age backup.tar
 
# recipients 파일 사용
age -R recipients.txt -o config.json.age config.json
 
# passphrase 기반 암호화
age --passphrase -o notes.txt.age notes.txt
 
# 복호화
age --decrypt -i key.txt -o secret.yaml secret.yaml.age
# recipients.txt
age1exampleexampleexampleexampleexampleexample
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleRecipient user@example
  • recipient 파일은 한 줄에 하나씩 공개 recipient를 둔다.
  • 빈 줄과 # 주석은 무시된다.
  • -를 파일 경로 대신 쓰면 stdin에서 recipient 또는 identity를 읽을 수 있다.
age는 OUTPUT 파일이 이미 존재하면 덮어쓸 수 있다. 민감한 원본/출력 경로를 분리해서 다루는 편이 안전하다.
  • no identity matched any of the recipients: 잘못된 secret key 파일을 썼거나, 암호화 때 사용한 recipient와 복호화 키가 맞지 않는다.
  • SSH key를 쓸 때 포맷 이슈가 나면 먼저 age-keygen native key를 시도해 보는 편이 단순하다.
  • passphrase 모드 파일을 identity처럼 재사용할 수는 있지만, 팀 배포 시에는 recipient 공개키 방식이 관리가 쉽다.
  • armor 출력은 사람이 다루기 편하지만 용량이 약간 증가한다.
  • 로컬 확인 버전: age v1.3.1
  • recipient 형식: native age1… 공개키, SSH public key
  • identity 형식: AGE-SECRET-KEY-1… 또는 SSH key 파일
  • gpg 기반 파일 암호화 워크플로보다 설정이 단순해서 최근 secret 관리 문맥에서는 age + sops 조합이 자주 선택된다.
  • 다만 기존 PGP 인프라가 이미 굳어져 있으면 sops –pgp 유지가 운영상 더 현실적일 수 있다.

age --help

age-keygen -h

  • codex:: 2026-06-17 Created age reference page with key generation, recipient, and decryption workflow examples.
  • codex:: 2026-06-19 Added Windows, macOS, Debian/Ubuntu, and Fedora/RHEL installation commands.
  • /home/u613600155/domains/cli.zerotymer.net/public_html/data/pages/age/ko.txt
  • 마지막으로 수정됨: 2026/06/19 00:38
  • 저자 127.0.0.1