일계부 데이터 Excel 일괄 업로드 기능 추가
관리자 > 임가현황
This commit is contained in:
46
README.md
46
README.md
@@ -184,7 +184,53 @@ spring:
|
||||
username: ENC(...)
|
||||
password: ENC(...)
|
||||
```
|
||||
작성_1 : pom.xml에 의존성추가
|
||||
```pom
|
||||
<dependency>
|
||||
<groupId>com.github.ulisesbocchio</groupId>
|
||||
<artifactId>jasypt-spring-boot-starter</artifactId>
|
||||
<version>3.0.5</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
작성_2 : 클래스 생성 후 실행
|
||||
```java
|
||||
import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
|
||||
|
||||
public class EncryptTest {
|
||||
public static void main(String[] args) {
|
||||
StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
|
||||
encryptor.setPassword("내Jasypt비번"); // jasypt.encryptor.password 값과 동일
|
||||
encryptor.setAlgorithm("PBEWITHHMACSHA512ANDAES_256"); // 설정에 맞춤
|
||||
|
||||
String plainText = "dbUserPassword"; // 평문
|
||||
String encrypted = encryptor.encrypt(plainText);
|
||||
|
||||
System.out.println("ENC(" + encrypted + ")");
|
||||
}
|
||||
}
|
||||
```
|
||||
작성_3 : 암호화 문자열 생성
|
||||
```scss
|
||||
ENC(mF3Z0fgCagFruOk/F2Z2PYzXhwGedE1secfYDgci+ke9z8xFEZ/GWbgXA4XeSq5D...)
|
||||
```
|
||||
작성_4 : 복호화
|
||||
```java
|
||||
import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
|
||||
|
||||
public class DecryptTest {
|
||||
public static void main(String[] args) {
|
||||
StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
|
||||
encryptor.setPassword("내Jasypt비번");
|
||||
encryptor.setAlgorithm("PBEWITHHMACSHA512ANDAES_256");
|
||||
|
||||
String encrypted = "mF3Z0fgCagFruOk/..."; // ENC(...) 안쪽
|
||||
String decrypted = encryptor.decrypt(encrypted);
|
||||
|
||||
System.out.println("복호화 결과 = " + decrypted);
|
||||
}
|
||||
}
|
||||
```
|
||||
---
|
||||
|
||||
## 🗃️ DB 구성
|
||||
|
||||
Reference in New Issue
Block a user