Re: PasswordSafe 3.0 weak random number generator allows key recovery attack

2006-09-07 Thread ronys
Just for the record, since this item is still being quoted:

- The reported weakness was a flaw in the *First Beta Release* of PasswordSafe 
3.0

- The flaw has been fixed since the second beta, released in April 2006.


  Rony


Re: PasswordSafe 3.0 weak random number generator allows key recovery attack

2006-03-27 Thread ronys
Hi,

- As has been pointed out, this is a BETA release, so it's a bit, er, inelegant 
to describe this as a flaw in 3.0. Guess I'll have to bump the release number 
when we fix this...

- At least this is an implementation flaw, as opposed to the format design flaw 
that the good folks at ElcomSoft found last time...

  Cheers,

Rony


PasswordSafe 3.0 weak random number generator allows key recovery attack

2006-03-23 Thread info

Title : PasswordSafe 3.0 weak random number generator allows key 
recovery attack
Date  : March 23, 2006
Product   : PasswordSafe 3.0
Discovered by : ElcomSoft Co.Ltd.


Overview
==

PasswordSafe is a program originally written by security expert
Bruce Schneier (http://www.schneier.com) that allows one to store
users' passwords in single file (called safe) which is
encrypted and protected by user's master password (called Safe
Combination) with the Blowfish encryption algorithm. As noted on
PasswordSafe web page, the program's security has been thoroughly
verified by Counterpane Labs under the supervision of Bruce Schneier,
author of Applied Cryptography and creator of the Blowfish algorithm.

As noted in Password Safe FAQ, there is no back door in
PasswordSafe to recover your Safe Combination, but there is a
password-guessing program that some people have used successfully.
The program works by going through a list of possible passwords
and checking each one.

Version 3.0 introduces new password database format which
(theoretically) eliminates security flaw found by ElcomSoft Co. Ltd.
in November 2005, and does not allow an attacker to bypass key
stretching algorithm any more.

However, there is even more serious security flaw in version 3.0,
which allows to recover 256-bit database encryption key in a
reasonable time (under certain conditions). And with the recovered
encryption key, it is to decrypt all database records (logins,
passwords, etc) without the master password (so-called Safe
Combination).


Details
==

PasswordSafe 3.0 utilizes two different random number generator (RNG)
functions: Win32 API RtlGenRandom() and standart Visual C++ rand().
RtlGenRandom() is not available on Windows prior to Windows XP (i.e.
Windows 2000, Windows NT, Windows Me) so rand() is used instead.
Specifically, rand() is used to generate 256-bit database encryption
key. It is widely known that using rand() in cryptographic
applications is not secure due to its predictbility and small
internal state.

It is possible to mount guaranteed decryption attack on PasswordSafe
3.0 databases created under OS prior to Windows XP. The attack is
very simple:

 1. Generate 256-bit key for every possible seed value 
 2. Decrypt first database record (the structure is documented, so
we have known plaintext attack)
 3) Check decrypted value against the known plaintext

The total number of all possible seed values is limited by 2^32, so
it is quite feasible. Our experiments show that the key can be
recovered in less than 6 hours on the single PC (Pentium 4).


Impact
==

PasswordSafe is used to store sensitive data, and so the presence
of such flaws may help attacker to disclose user's logins,
passwords and PINs by implementing efficient key recovery attacks.


Solution/workaround
==

PasswordSafe should not use rand() function; cryptographic RNG should
be used instead.


References
==

Bruce Schneier - Password Safe
http://www.schneier.com/passsafe.html

Password Safe - Project Info
http://passwordsafe.sourceforge.net/

Password Safe FAQ
http://www.schneier.com/passsafe-faq.html

BugTraq: Schneier's PasswordSafe password validation flaw
http://www.securityfocus.com/archive/1/416873/30/0/threaded


About ElcomSoft Co.Ltd.
==

Since 1990, ElcomSoft Co.Ltd. (http://www.elcomsoft.com) has been
developing and marketing password recovery, forensics, and security
software for Windows. The company offers a comprehensive line of
password recovery software for more than 80 popular file and document
types, email clients, compression programs, instant messengers, and
other applications. ElcomSoft tools are used by most of the
Fortune 500 corporations, many branches of the military all over the
world, foreign governments, and all major accounting companies.




Re: PasswordSafe 3.0 weak random number generator allows key recovery attack

2006-03-23 Thread Dave Korn
[EMAIL PROTECTED] wrote:
 Title : PasswordSafe 3.0 weak random number generator allows
 key recovery attack
 Date  : March 23, 2006
 Product   : PasswordSafe 3.0

  Say, are you referring to /the/ PasswordSafe 3.0, you know, the one by 
that Schneier guy, the one that's on sourceforge, .

 ... the one that's still in BETA for god's sake and which comes plastered 
in warnings like

 This is still a BETA release! It should NOT be used as the only tool for 
storing real password information. For securely storing real password 
entries, please use release 2.16.

  ;-) Heh, this is a QC / bug report, not a security advisory!  There is 
currently no such thing as PasswordSafe 3.0, and 
http://passwordsafe.sourceforge.net/ refers to it as 3.0Beta1.  (But yeh, 
this is a valid issue and of course should be fixed before the product is 
actually released).

 It is possible to mount guaranteed decryption attack on PasswordSafe
 3.0 databases created under OS prior to Windows XP. The attack is
 very simple:

 1. Generate 256-bit key for every possible seed value
 2. Decrypt first database record (the structure is documented, so
we have known plaintext attack)
 3) Check decrypted value against the known plaintext

 The total number of all possible seed values is limited by 2^32, so
 it is quite feasible. Our experiments show that the key can be
 recovered in less than 6 hours on the single PC (Pentium 4).

 Solution/workaround
 ==

 PasswordSafe should not use rand() function; cryptographic RNG should
 be used instead.

  I think he should probably pre-pend a random amount of random pad bytes to 
the start of the file as well.  Help to hide the known plaintext from even 
being at a known offset into the ciphertext stream.



cheers,
  DaveK
-- 
Can't think of a witty .sigline today