It's possible to encrypt or at least obfuscate the ecryption password?
Im pretty curious about encryption in java
I'm following this tutorial and it's pretty interesting but my main problem is https://medium.com/@javatechie/spring-boot-password-encryption-using-jasypt-e92eed7343ab
when we reach this code:
@Configuration
public class JasyptEncryptorConfig { @Bean(name = "jasyptStringEncryptor")
public StringEncryptor getPasswordEncryptor() {
PooledPBEStringEncryptor encryptor = new PooledPBEStringEncryptor();
SimpleStringPBEConfig config = new SimpleStringPBEConfig();
config.setPassword("javatechie"); // encryptor's private key
config.setAlgorithm("PBEWithMD5AndDES");
config.setKeyObtentionIterations("1000");
config.setPoolSize("1");
config.setProviderName("SunJCE");
config.setSaltGeneratorClassName("org.jasypt.salt.RandomSaltGenerator");
config.setStringOutputType("base64");
encryptor.setConfig(config);
return encryptor;
}
}
config.setPassword("javatechie"); // encryptor's private key in my opinion is a huge security break someone who reach and decompile the jar will get for sure the encryption password.
So my main question is it's possible to encrypt that password or obfuscate with something in order to make a huge challenge or at least make it impossible with a simple sight get the password?
I'm just curious i tried with some kind of bit shifting "<<" but it's so simple that at the end the string with the true password needs to be hardcoded somewhere.