<p>This is really a Bash question, but I'll bite.</p>

<p>Bash (or any UNIX shell) will treat <code>"</code> symbols as begin and end of a literal. Inside <code>""</code>, spaces and special characters inside that would otherwise have a special meaning are permitted.</p>

<p>One of the permitted special characters inside is the newline. That's exactly what's happening here. Your <code>"test""</code> plus <code>"</code> on the next line is seen as <code>"test"</code> plus a newline between quotation marks. As a result, your new password is <code>test</code> plus a newline character.</p>

<p>If you would want <code>test"</code> as your password, one way would be to use single quotes instead of double quotes. One of the characters permitted inside single quotes is... the double quote character.</p>

<p>So you could use</p>

<pre><code>walletpassphrasechange 'test' 'test"'
</code></pre>

CC BY-SA 3.0
2017-11-23T10:33:56.930Z
./qtum-cli walletpassphrasechange "test" "test"" > ".   If this command passed through, what do you think the new password might be? As you mentioned, test plus a newline character is not working. So far, I have tried test, test"", test\n, test"\n". They all don't work.
JayB Kim
CC BY-SA 3.0
2017-11-23T15:32:23.213Z
Try $'test\n'. The $ in front tells the shell to interpret sequences like \n rather than take them literally.
Pieter Wuille
CC BY-SA 3.0
2017-11-24T00:22:50.857Z
i'll try that and let you know if it is right or not.
JayB Kim
CC BY-SA 3.0
2017-11-24T01:03:24.733Z
wow! ```$'test\n'```work! thank you so much!
JayB Kim
CC BY-SA 3.0
2017-11-24T01:34:23.893Z
Can you elaborate a little more about how it is changed to ```$'test\n'``` ? I don't really get it..... ```"test""```plus newline ```"``` becomes ```$'test\n'``` Now, i know $ sign tells the shell to interpret sequences like \n, but how this double quotation mark ```"``` changed to the single quotation mark ```'``` and it is positioned right before the word ```test```?
JayB Kim
CC BY-SA 3.0
2017-11-24T01:38:35.220Z
If I type ```test"```plus newline ```"``` (not ```"test""```), then what would be the new password?
JayB Kim
CC BY-SA 3.0
2017-11-23T06:50:11.807Z
2017-11-23T06:50:11.807Z
Pieter Wuille
<p><strong>I installed Qtum core in my Ubuntu 16.04 server and generated my wallet, and encrypted it.</strong></p>

<p>For the test purpose, I changed the password using the command like below.</p>

<p>I typed below command to change my password.</p>

<blockquote>
  <p>./qtum-cli walletpassphrasechange "oldpassphrase" "newpassphrase"</p>
</blockquote>

<p>Let's say my oldpassphrase is test and my new passphrase is test"</p>

<p>Notice that I type the double quotation mark right after the word test</p>

<blockquote>
  <p>./qtum-cli walletpassphrasechange "test" "test""</p>
</blockquote>

<p>This returns below line that asks me to close the double quotation mark.</p>

<blockquote>
  <p>></p>
</blockquote>

<p>So I typed " to close it.</p>

<p>Surprisingly, the command line has passed!</p>

<p>I thought the new password would be test" or test""</p>

<p>But they both do not work.</p>

<p>Can anyone guess what the new password might be?</p>

<blockchain><linux><ubuntu><encryption>
Changing wallet password using double quotation marks turn out to be mysterious (Qtum Core)
JayB Kim
# Changing wallet password using double quotation marks turn out to be mysterious (Qtum Core)

(Asked by: username_0 on 2017-11-23)

**I installed Qtum core in my Ubuntu 16.04 server and generated my wallet, and encrypted it.**

For the test purpose, I changed the password using the command like below.

I typed below command to change my password.

> ./qtum-cli walletpassphrasechange "oldpassphrase" "newpassphrase"

Let's say my oldpassphrase is test and my new passphrase is test"

Notice that I type the double quotation mark right after the word test

> ./qtum-cli walletpassphrasechange "test" "test""

This returns below line that asks me to close the double quotation mark.

> >

So I typed " to close it.

Surprisingly, the command line has passed!

I thought the new password would be test" or test""

But they both do not work.

Can anyone guess what the new password might be?

**Tags:** blockchain, linux, ubuntu, encryption


---

## 1 answers

### Answer by username_1 on 2017-11-23. Score: 1

This is really a Bash question, but I'll bite.
Bash (or any UNIX shell) will treat " symbols as begin and end of a literal. Inside "", spaces and special characters inside that would otherwise have a special meaning are permitted.
One of the permitted special characters inside is the newline. That's exactly what's happening here. Your "test"" plus " on the next line is seen as "test" plus a newline between quotation marks. As a result, your new password is test plus a newline character.
If you would want test" as your password, one way would be to use single quotes instead of double quotes. One of the characters permitted inside single quotes is... the double quote character.
So you could use
walletpassphrasechange 'test' 'test"'

> **Comments:**
> **username_0**: ./qtum-cli walletpassphrasechange "test" "test"" > ".   If this command passed through, what do you think the new password might be? As you mentioned, test plus a newline character is not working. So far, I have tried test, test"", test\n, test"\n". They all don't work.  
> **username_1**: Try $'test\n'. The $ in front tells the shell to interpret sequences like \n rather than take them literally.  
> **username_0**: i'll try that and let you know if it is right or not.  
> **username_0**: wow! ```$'test\n'```work! thank you so much!  
> **username_0**: Can you elaborate a little more about how it is changed to ```$'test\n'``` ? I don't really get it..... ```"test""```plus newline ```"``` becomes ```$'test\n'``` Now, i know $ sign tells the shell to interpret sequences like \n, but how this double quotation mark ```"``` changed to the single quotation mark ```'``` and it is positioned right before the word ```test```?  
> **username_0**: If I type ```test"```plus newline ```"``` (not ```"test""```), then what would be the new password?  

---

