-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat:AES 암호화 방식 유틸리티 추가#15 #16
base: feature/#13-login
Are you sure you want to change the base?
Conversation
@Slf4j 애노테이션을 클래스에 붙이면 자동으로 log 객체를 생성합니다. | ||
log 객체를 직접 생성하지 않고 log 메서드를 사용할 수 있습니다. | ||
*/ | ||
@Slf4j |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
해당 어노테이션의 동작방식에 대해서도 적어주시면 더 좋을 것 같습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네 추가했습니다 :)
private static final String ALGORITHM = "AES/CBC/PKCS5Padding"; | ||
/** | ||
* TODO | ||
* 패스워드와 salt를 어떻게 보관할 것인지 고민입니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
password 와 salt 의 차이는 무엇인가요? application.yml 에 보관하는 것은 어떨까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
password는 암호화 및 복호화를 위해 필요한 key입니다
동일한 key를 가지고 만든 암호화 데이터는 모두 같은 key를 통해 복호화가 가능하므로 보안상 위험합니다.
따라서 password에 salt의 임의의 값을 추가하여 암호화를 하는 경우에는 암호화 결과가 다르게 나오게 됩니다.
현재 로직에서는 고정된 salt를 사용하여 salt를 사용하는 의미가 없어졌습니다.
} | ||
|
||
private static IvParameterSpec generateIv() { | ||
byte[] iv = new byte[16]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
매직넘버는 상수로 뺴는 것이 좋습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네 수정하겠습니다 !!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다!
#️⃣ 연관된 이슈
📝작업 내용
✒️ 코드 변경 이유
💬리뷰 요구사항(선택)
객체지향 체조 3가지 확인📌