question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

wrong decryption of password/cipher

See original GitHub issue

Following the description at http://cloud.spring.io/spring-cloud-config/spring-cloud-config.html#_encryption_and_decryption I tried to encrypt and decrypt my passwords. This works all fine, unless the password contains a “+” (plus) sign. If I decrypt the cipher of a encrypted password with a “+” then the resulting string does not contain the “+” anymore.

e.g.

$> curl localhost:8080/encrypt -d myp+ass
$> 3bd5c274f5d5bdcb9c93069a370a17ca4b8abc8174e8178a2f36134758d946f9
$> curl localhost:8080/decrypt -d 3bd5c274f5d5bdcb9c93069a370a17ca4b8abc8174e8178a2f36134758d946f9
$> myp ass   # -> missing "+"

I also tried with with escaping “myp+ass”, but it does not help either. This seem not like such a big deal when you have the chance to define your passwords by yourself, but when the passwords are generated then this is a blocker (like on AWS).

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dsyercommented, Oct 6, 2015

It works if you encode the input:

$ CIPHER=`curl localhost:8888/encrypt -d my%2Bpass`
$ curl localhost:8888/decrypt -d $CIPHER
my+pass

also if you use Content-Type: text/plain:

$ CIPHER=`curl -H "Content-Type: text/plain" localhost:8888/encrypt -d my+pass`
$ curl localhost:8888/decrypt -d $CIPHER
my+pass

or with --data-urlencode:

$ CIPHER=`curl localhost:8888/encrypt --data-urlencode my+pass`
$ curl localhost:8888/decrypt -d $CIPHER
my+pass
0reactions
imodcommented, Oct 7, 2015

👍 yes, encoded works - thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Does decryption with a wrong key creates a new encryption?
I'm wondering if decrypting with a wrong key is the same a encrypting in a different way. For example if I encrypt the...
Read more >
Advanced encryption | Atlassian Support
Key used to encrypt your password. You will need this file to decrypt your password. java.security.AlgorithmParameters_[timestamp] Algorithm ...
Read more >
#964318 - password encryption/decryption broken with PHP 7.4
The error is most probably due to PHP 7.4 incompatible gosa code, ... causing the error: function cred_encrypt($input, $password, $cipher ...
Read more >
"java.lang.Exception: Failed to decode password, decryption ...
Exception: Failed to decode password, decryption error. Input length must be multiple of 8 when decrypting with padded cipher" (Doc ID ...
Read more >
Datasource Ciphered Password example - Apache TomEE
public static class ReverseEncryption implements PasswordCipher { @Override public char[] ... toCharArray(); } @Override public String decrypt(char[] ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found