Open youngyin opened 9 months ago
encryption sensitive_value
implementation 'org.jasypt:jasypt-spring-boot-starter'
java -cp jasypt-3.0.4.jar org.jasypt.intf.cli.JasyptPBEStringEncryptionCLI input="your_sensitive_value" password=mySecretKey algorithm=PBEWithMD5AndDES
import org.jasypt.encryption.pbe.StandardPBEStringEncryptor import org.springframework.beans.factory.annotation.Value import org.springframework.stereotype.Service
@Service class MyService(private val encryptor: StandardPBEStringEncryptor) {
@Value("\${my.secret.encrypted.property}") private lateinit var encryptedProperty: String fun getDecryptedProperty(): String { return encryptor.decrypt(encryptedProperty) }
}
[참고]
encryption sensitive_value
@Service class MyService(private val encryptor: StandardPBEStringEncryptor) {
}