Skip to content

✨개인정보 AES암호화#171

Merged
kimyeoungrok merged 12 commits intodevfrom
feat/#170-Crypto
Dec 30, 2025
Merged

✨개인정보 AES암호화#171
kimyeoungrok merged 12 commits intodevfrom
feat/#170-Crypto

Conversation

@kimyeoungrok
Copy link
Copy Markdown
Contributor

✨ Related Issue

#170

📌 Task Details

  • AES암호화 서비스 로직 작성
  • AES암호화 JPA Converter 클래스 생성
  • AES암복호화시 에러처리
  • AES암복호화 에러 테스트코드 작성

💬 Review Requirements (Optional)

암복호화시 에러가 나면 다음과 같이 뜸
image

일부러 미등록 뜨게 해놓음(암복호화 에러라고 굳이 프론트에 띄울 필요는 없는 것 같음)

하지만 서버 로그에는 원인 파악 가능하게 로그하고 에러 뜨게 해 놓음(에러 처리 전엔 아무 것도 안 떴음)
image
image

@kimyeoungrok kimyeoungrok self-assigned this Dec 18, 2025
if (encrypted == null) return null
return try {
val decoded = Base64.getDecoder().decode(encrypted)
require(decoded.size > GCM_IV_LENGTH) { "Invalid encrypted text" }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IV에 TAG 길이를 더하여 같이 고려해서 검증하면 더 좋을 거 같습니다!

}

override fun convertToDatabaseColumn(raw: String?): String? {
if (raw == null) return null
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

검증 시 null 뿐 아니라 빈 문자열이나 공백을 포함하는 문자열 등의 케이스도 같이 고려하면 더 좋을 거 같아요!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

공백을 포함하는 문자열도 처리했으면 좋겠다는 말은 공백을 포함했을 때 에러나 null을 반환하라는 거야 아님 공백을 포함하면 (" hello" -> "hello")와 같이 공백을 제거하라는 뜻이야?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

음 난 전자로 생각하긴 했는데 다시 보니까 null 일때만 null을 반환하는게 더 명확하려나..? 그대로 가도 괜찮을 거 같기도 해요

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그럼 null말고 완전 공백인 것들도 추가로 null값 반환하는 것까지만 할게!

@minzix
Copy link
Copy Markdown
Member

minzix commented Dec 27, 2025

수고 많으셨습니다!! 코멘트 확인 후 머지해주시면 될 거 같습니당

@kimyeoungrok kimyeoungrok merged commit 21b30c4 into dev Dec 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants