feat: E2EE 암호화 유틸리티 구현 (#28) #29

Merged
seonkyu.kim merged 1 commits from feature/#28-e2ee-crypto into develop 2026-02-09 07:36:56 +00:00
Owner

📋 작업 요약

  • RSA-2048 + AES-256 하이브리드 E2EE 암복호화 구현
  • 보안등급 3 엔드포인트용 SecureTransport Action Filter 구현
  • 타임스탬프 검증 (±30초) 재전송 공격 방지

Closes #28

🛠️ 작업 내용 (Changes)

  • SPMS.Infrastructure/Security/AesEncryption.cs — AES-256-CBC 암호화/복호화, Key/IV 생성
  • SPMS.Infrastructure/Security/RsaEncryption.cs — RSA-2048 OAEP-SHA256 암복호화, 키 쌍 생성
  • SPMS.Application/Interfaces/IE2EEService.cs — E2EE 서비스 인터페이스 및 DecryptResult 정의
  • SPMS.Infrastructure/Security/E2EEService.cs — 하이브리드 암복호화 구현 (Security.md §4 패킹 구조 준수)
  • SPMS.Infrastructure/Security/TimestampValidator.cs — Unix timestamp ±30초 검증
  • SPMS.API/Filters/SecureTransportAttribute.cs — IAsyncResourceFilter 기반 요청 복호화/응답 암호화
  • SPMS.Infrastructure/DependencyInjection.cs — IE2EEService DI 등록 (Singleton)

📢 리뷰어 참고 사항 (To Reviewers)

  • 패킹 구조: 요청 [EncryptedKey(256B)] + [IV(16B)] + [EncryptedBody], 응답 [IV(16B)] + [EncryptedBody]
  • RSA 키는 E2EE:PrivateKeyPath (파일 경로) 또는 E2EE:PrivateKeyPem (직접 PEM)으로 설정
  • 키 미설정 시 앱은 정상 시작되고, [SecureTransport] 적용 엔드포인트 호출 시 에러 반환
  • [SecureTransport] 어트리뷰트를 L3/L4 보안등급 엔드포인트(로그인, 비밀번호 변경 등)에 적용 예정

체크리스트 (Self Checklist)

  • 빌드(Build)가 성공적으로 수행되었는가?
  • 모든 단위 테스트(Unit Test)를 통과하였는가?
  • 불필요한 로그나 주석을 제거하였는가?
  • 컨벤션(Clean Architecture, Naming)을 준수하였는가?
  • 기밀 정보(비밀번호, 키 등)가 하드코딩 되어있지 않은가?

📸 스크린샷 / 테스트 로그 (Screenshots/Logs)

빌드했습니다.
    경고 0개
    오류 0개
## 📋 작업 요약 - RSA-2048 + AES-256 하이브리드 E2EE 암복호화 구현 - 보안등급 3 엔드포인트용 SecureTransport Action Filter 구현 - 타임스탬프 검증 (±30초) 재전송 공격 방지 ## 🔗 관련 이슈 (Related Issues) Closes #28 ## 🛠️ 작업 내용 (Changes) - [x] `SPMS.Infrastructure/Security/AesEncryption.cs` — AES-256-CBC 암호화/복호화, Key/IV 생성 - [x] `SPMS.Infrastructure/Security/RsaEncryption.cs` — RSA-2048 OAEP-SHA256 암복호화, 키 쌍 생성 - [x] `SPMS.Application/Interfaces/IE2EEService.cs` — E2EE 서비스 인터페이스 및 DecryptResult 정의 - [x] `SPMS.Infrastructure/Security/E2EEService.cs` — 하이브리드 암복호화 구현 (Security.md §4 패킹 구조 준수) - [x] `SPMS.Infrastructure/Security/TimestampValidator.cs` — Unix timestamp ±30초 검증 - [x] `SPMS.API/Filters/SecureTransportAttribute.cs` — IAsyncResourceFilter 기반 요청 복호화/응답 암호화 - [x] `SPMS.Infrastructure/DependencyInjection.cs` — IE2EEService DI 등록 (Singleton) ## 📢 리뷰어 참고 사항 (To Reviewers) - 패킹 구조: 요청 `[EncryptedKey(256B)] + [IV(16B)] + [EncryptedBody]`, 응답 `[IV(16B)] + [EncryptedBody]` - RSA 키는 `E2EE:PrivateKeyPath` (파일 경로) 또는 `E2EE:PrivateKeyPem` (직접 PEM)으로 설정 - 키 미설정 시 앱은 정상 시작되고, `[SecureTransport]` 적용 엔드포인트 호출 시 에러 반환 - `[SecureTransport]` 어트리뷰트를 L3/L4 보안등급 엔드포인트(로그인, 비밀번호 변경 등)에 적용 예정 ## ✅ 체크리스트 (Self Checklist) - [x] 빌드(Build)가 성공적으로 수행되었는가? - [x] 모든 단위 테스트(Unit Test)를 통과하였는가? - [x] 불필요한 로그나 주석을 제거하였는가? - [x] 컨벤션(Clean Architecture, Naming)을 준수하였는가? - [x] 기밀 정보(비밀번호, 키 등)가 하드코딩 되어있지 않은가? ## 📸 스크린샷 / 테스트 로그 (Screenshots/Logs) ``` 빌드했습니다. 경고 0개 오류 0개 ```
seonkyu.kim added 1 commit 2026-02-09 07:35:58 +00:00
- AesEncryption: AES-256-CBC 암호화/복호화
- RsaEncryption: RSA-2048 키 쌍 생성/암복호화
- E2EEService: 하이브리드 암복호화 (요청 복호화, 응답 암호화)
- TimestampValidator: 타임스탬프 검증 (±30초)
- SecureTransportAttribute: Action Filter (보안등급 3 엔드포인트용)
- DI 등록: IE2EEService → E2EEService (Singleton)

Closes #28
seonkyu.kim added the
Priority
High
Status
In Progress
Type
Feature
labels 2026-02-09 07:36:07 +00:00
seonkyu.kim self-assigned this 2026-02-09 07:36:08 +00:00
seonkyu.kim added this to the Phase 1: 인프라 & 공통 모듈 milestone 2026-02-09 07:36:13 +00:00
seonkyu.kim requested review from Owners 2026-02-09 07:36:20 +00:00
seonkyu.kim merged commit fb0da8669d into develop 2026-02-09 07:36:56 +00:00
seonkyu.kim deleted branch feature/#28-e2ee-crypto 2026-02-09 07:37:10 +00:00
seonkyu.kim added
Status
Done
and removed
Status
In Progress
labels 2026-02-09 07:37:46 +00:00
Sign in to join this conversation.
No description provided.