title: Encrypting Eureka Server Password
body: <p>Is there a way to encrypt the password. I tried below code but it doesn't work (not using spring-cloud-config).</p>
  
  <pre><code>StandardPasswordEncoder encoder = new StandardPasswordEncoder("eurekaserverpassword");
  String encryptedValue = encoder.encode("password");
  </code></pre>
  
  <p>The generated password is placed in application.yml</p>
  
  <pre><code>security:
    user:
      password: '{cipher}3da45506d8dd45b29d5db2a52c23bd6bc2e129372846cc51cdb8397e2a641eb12dfbc61757ddcf42'
  </code></pre>
  
  <p>And defined the key in bootstrap.yml</p>
  
  <pre><code>encrypt:
    key:eurekaserverpassword
  </code></pre>
  
  <p>I'm getting below error</p>
  
  <pre><code>UnsupportedOperationException: No decryption for FailsafeTextEncryptor. Did you configure the keystore correctly?
  </code></pre>
  
  <p>I'm not using asymmetric approach, why it is looking for keystore?</p>
  
  <p>POM.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;com.eureka&lt;/groupId&gt;
    &lt;artifactId&gt;eureka-server&lt;/artifactId&gt;
    &lt;version&gt;1.0&lt;/version&gt;
    &lt;packaging&gt;jar&lt;/packaging&gt;
    &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;start-class&gt;com.demo.EurekaApplication&lt;/start-class&gt;
      &lt;java.version&gt;1.7&lt;/java.version&gt;
      &lt;spring-cloud.version&gt;1.0.0.RELEASE&lt;/spring-cloud.version&gt;
    &lt;/properties&gt;
    &lt;name&gt;Eureka Server&lt;/name&gt;
    &lt;description&gt;Eureka Server&lt;/description&gt;
    &lt;dependencyManagement&gt;
      &lt;dependencies&gt;
        &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
          &lt;artifactId&gt;spring-cloud-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;${spring-cloud.version}&lt;/version&gt;
          &lt;type&gt;pom&lt;/type&gt;
          &lt;scope&gt;import&lt;/scope&gt;
        &lt;/dependency&gt;
      &lt;/dependencies&gt;
    &lt;/dependencyManagement&gt;
    &lt;dependencies&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-starter-tomcat&lt;/artifactId&gt;
        &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
        &lt;artifactId&gt;spring-cloud-starter-eureka-server&lt;/artifactId&gt;
      &lt;/dependency&gt; 
      &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;
     &lt;/dependency&gt; 
      &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
        &lt;artifactId&gt;spring-security-rsa&lt;/artifactId&gt;
     &lt;/dependency&gt;   
    &lt;/dependencies&gt;
    &lt;build&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;1.2.1.RELEASE&lt;/version&gt;
          &lt;executions&gt;
              &lt;execution&gt;
                  &lt;goals&gt;
                     &lt;goal&gt;repackage&lt;/goal&gt;
                  &lt;/goals&gt;
               &lt;/execution&gt;
          &lt;/executions&gt;
          &lt;configuration&gt;
            &lt;requiresUnpack&gt;
              &lt;dependency&gt;
                &lt;groupId&gt;com.netflix.eureka&lt;/groupId&gt;
                &lt;artifactId&gt;eureka-core&lt;/artifactId&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                &lt;groupId&gt;com.netflix.eureka&lt;/groupId&gt;
                &lt;artifactId&gt;eureka-client&lt;/artifactId&gt;
              &lt;/dependency&gt;
            &lt;/requiresUnpack&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>