brentmaxwell / cryptophane

Automatically exported from code.google.com/p/cryptophane
GNU General Public License v2.0
0 stars 0 forks source link

Password not valid but good #9

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?
password accept
password not valid

What version of the product are you using? On what operating system?
0.7.0.

Please provide any additional information below.

when i sign key or decrypt file i past my very long password from clipboard
in inputbox. But it result every not valid. Instead i not have problem with
GPGee.

Original issue reported on code.google.com by diamant...@gmail.com on 19 Apr 2010 at 7:22

GoogleCodeExporter commented 9 years ago
Agreed, this is an issue, as most (common sense people) will use the max (64 
characters).
I have a pregenerated, 64-character hex key (0-9,a-z) pasting correctly into 
the field.
After entering a message to encrypt & sign, I paste the password in.
Manually counting the asterisks, there are, indeed, 64 of them.
Pressing OK will make the prompt appear twice more, having to paste in again.
After third attempt, the following error is given:

---------------------------
Error
---------------------------
An error occurred while performing the requested operation.

Unknown error encrypting/signing

[GNUPG:] USERID_HINT A541F7812D19737D Trevor Lane Ray <trevorlaneray@gmail.com>
[GNUPG:] NEED_PASSPHRASE A541F7812D19737D A541F7812D19737D 17 0
[GNUPG:] GET_HIDDEN passphrase.enter
[GNUPG:] GOT_IT
[GNUPG:] BAD_PASSPHRASE A541F7812D19737D
[GNUPG:] USERID_HINT A541F7812D19737D Trevor Lane Ray <trevorlaneray@gmail.com>
[GNUPG:] NEED_PASSPHRASE A541F7812D19737D A541F7812D19737D 17 0
[GNUPG:] GET_HIDDEN passphrase.enter
[GNUPG:] GOT_IT
[GNUPG:] BAD_PASSPHRASE A541F7812D19737D
[GNUPG:] USERID_HINT A541F7812D19737D Trevor Lane Ray <trevorlaneray@gmail.com>
[GNUPG:] NEED_PASSPHRASE A541F7812D19737D A541F7812D19737D 17 0
[GNUPG:] GET_HIDDEN passphrase.enter
[GNUPG:] GOT_IT
[GNUPG:] BAD_PASSPHRASE A541F7812D19737D
gpg: Invalid passphrase; please try again ...
gpg: Invalid passphrase; please try again ...
gpg: no default secret key: bad passphrase
gpg: C:\Users\TREVOR~1\AppData\Local\Temp\CryFE5.tmp: sign+encrypt failed: bad 
passphrase

---------------------------
OK   
---------------------------

I suspect this may have something to do with pasting?
Is it only allowable to manually key in passphrases?

Original comment by trevorla...@gmail.com on 4 Apr 2014 at 9:35

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Looking at 
https://code.google.com/p/cryptophane/source/browse/trunk/src/Passphrase.pas

...
PassphraseEdit.MaxLength := 64;
  PassphraseEdit.Text := '';
  try
    result := false;
    if ShowModal <> mrOK then Exit;
    StrLCopy(passphrase, PChar(PassphraseEdit.Text), 63);
    result := true;
  finally
    blank := '';
    for i := 1 to Length(PassphraseEdit.Text) do blank := blank + ' ';
    PassphraseEdit.Text := blank;
    PassphraseEdit.Text := '';
  end;
...

Issue might be here.
Tried it myself; can confirm that only passwords <=63 chars will work.
>=64 chars will create an error, as mentioned.
Maybe initialize the loop with counter i := 0 so as to iterate the full 64 
chars?

Original comment by trevorla...@gmail.com on 4 Apr 2014 at 9:59