Documentation
¶
Overview ¶
Package sealer 는 산출물 암호화 구현체다.
설계: docs/11_기능설계/Nullus_백업복구_설계.md §5.4 (nullus-plan#75)
pkg/crypto/aes_gcm.go 를 쓰지 않는 이유: 그 API 는 []byte 전체를 받아 base64 문자열을 돌려주므로 수십 GB 짜리 볼륨 아카이브에 쓸 수 없다. 같은 알고리즘(AES-256-GCM)의 스트리밍 변형이 필요하다.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StreamSealer ¶
type StreamSealer struct {
// contains filtered or unexported fields
}
StreamSealer 는 AES-256-GCM 을 조각 단위로 적용한다.
조각마다 nonce 는 (랜덤 8바이트 접두사 || 조각 번호 4바이트) 다. 접두사가 봉인마다 새로 생성되므로 키 재사용에도 nonce 가 겹치지 않는다.
각 조각의 AAD 에 조각 번호와 "마지막 조각인가" 를 넣는다. 이것이 없으면 공격자가 뒤쪽 조각을 잘라내도 복호화가 성공해 버린다 — 백업본이 조용히 짧아지는 것은 무결성 검증을 통과한 손상이라 가장 나쁘다.
func NewStreamSealer ¶
func NewStreamSealer(keyID string, key []byte) (*StreamSealer, error)
func (*StreamSealer) KeyID ¶
func (s *StreamSealer) KeyID() string
Click to show internal directories.
Click to hide internal directories.