<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://en.zaoniao.it/index.php?action=history&amp;feed=atom&amp;title=Bcrypt</id>
	<title>Bcrypt - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://en.zaoniao.it/index.php?action=history&amp;feed=atom&amp;title=Bcrypt"/>
	<link rel="alternate" type="text/html" href="http://en.zaoniao.it/index.php?title=Bcrypt&amp;action=history"/>
	<updated>2026-05-15T23:05:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.32.0</generator>
	<entry>
		<id>http://en.zaoniao.it/index.php?title=Bcrypt&amp;diff=3111&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;{{#seo: |title=Bcrypt – Encryption, Decryption algorithm – zaoniao Wiki |keywords=Bcrypt, generator, password, encryption, decrypt, security, hash |description=Bcrypt is a...&quot;</title>
		<link rel="alternate" type="text/html" href="http://en.zaoniao.it/index.php?title=Bcrypt&amp;diff=3111&amp;oldid=prev"/>
		<updated>2019-04-11T03:49:57Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{#seo: |title=Bcrypt – Encryption, Decryption algorithm – zaoniao Wiki |keywords=Bcrypt, generator, password, encryption, decrypt, security, hash |description=Bcrypt is a...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{#seo:&lt;br /&gt;
|title=Bcrypt – Encryption, Decryption algorithm – zaoniao Wiki&lt;br /&gt;
|keywords=Bcrypt, generator, password, encryption, decrypt, security, hash&lt;br /&gt;
|description=Bcrypt is a password hashing function designed by Niels Provos and David Mazière. There are implementations of bcrypt for C, C#, Java, PHP, Python,  Scala and other languages. The bcrypt algorithm is the result of encrypting the phrase using Blowfish.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;amp/&amp;gt;&lt;br /&gt;
[[File:bcrypt.png|530px|right|Bcrypt online password generator]]&lt;br /&gt;
'''Bcrypt''' is a [[Cryptographic hash function#Password verification|password hashing function]] designed by [[Niels Provos]] and David Mazières, based on the Blowfish cipher, and presented at USENIX in 1999. Besides incorporating a salt to protect against rainbow table attacks, bcrypt is an adaptive function: over time, the iteration count can be increased to make it slower, so it remains resistant to brute-force search attacks even with increasing computation power.&lt;br /&gt;
&lt;br /&gt;
The bcrypt function is the default password hash algorithm for OpenBSD and other systems including some Linux distributions such as SUSE Linux.&lt;br /&gt;
The prefix &amp;quot;$2a$&amp;quot; or &amp;quot;$2b$&amp;quot; (or &amp;quot;$2y$&amp;quot;) in a hash string in a shadow password file indicates that hash string is a bcrypt hash in modular crypt format.&lt;br /&gt;
The rest of the hash string includes the cost parameter, a 128-bit salt (Radix-64 encoded as 22 characters), and 184 bits of the resulting hash value (Radix-64 encoded as 31 characters). The Radix-64 encoding uses the unix/crypt alphabet, and is not 'standard' Base-64. The cost parameter specifies a key expansion iteration count as a power of two, which is an input to the crypt algorithm.&lt;br /&gt;
&lt;br /&gt;
For example, the shadow password record &amp;lt;code&amp;gt;$2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy&amp;lt;/code&amp;gt; specifies a cost parameter of 10, indicating 2&amp;lt;sup&amp;gt;10&amp;lt;/sup&amp;gt; key expansion rounds. The salt is &amp;lt;code&amp;gt;N9qo8uLOickgx2ZMRZoMye&amp;lt;/code&amp;gt; and the resulting hash is &amp;lt;code&amp;gt;IjZAgcfl7p92ldGxad68LJZdL17lhWy&amp;lt;/code&amp;gt;. Per standard practice, the user's password itself is not stored.&lt;br /&gt;
&lt;br /&gt;
There are implementations of bcrypt for C, C#, Go, Java, JavaScript, Perl, PHP, Python, Ruby and other languages.&lt;br /&gt;
&lt;br /&gt;
==Bcrypt password generator==&lt;br /&gt;
Blowfish is notable among block ciphers for its expensive key setup phase. It starts off with subkeys in a standard state, then uses this state to perform a block encryption using part of the key, and uses the result of that encryption (which is more accurately a hashing) to replace some of the subkeys. Then it uses this modified state to encrypt another part of the key, and uses the result to replace more of the subkeys. It proceeds in this fashion, using a progressively modified state to hash the key and replace bits of state, until all subkeys have been set.&lt;br /&gt;
&lt;br /&gt;
Provos and Mazières took advantage of this, and took it further. They developed a new key setup algorithm for Blowfish, dubbing the resulting cipher &amp;quot;Eksblowfish&amp;quot; (&amp;quot;expensive key schedule Blowfish&amp;quot;). The key setup begins with a modified form of the standard Blowfish key setup, in which both the salt and password are used to set all subkeys. There are then a number of rounds in which the standard Blowfish keying algorithm is applied, using alternatively the salt and the password as the key, each round starting with the subkey state from the previous round. In theory, this is no stronger than the standard Blowfish key schedule, but the number of rekeying rounds is configurable; this process can therefore be made arbitrarily slow, which helps deter brute-force attacks upon the hash or salt.&lt;br /&gt;
&lt;br /&gt;
== Versioning History ==&lt;br /&gt;
&lt;br /&gt;
''' $2$ (1999) '''&lt;br /&gt;
&lt;br /&gt;
The original Bcrypt specification defined a prefix of &amp;lt;code&amp;gt;$2$&amp;lt;/code&amp;gt;. This follows the '''Modular Crypt Format''' format used when storing passwords in the OpenBSD password file:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;$1$&amp;lt;/code&amp;gt;: MD5 &lt;br /&gt;
* &amp;lt;code&amp;gt;$2$&amp;lt;/code&amp;gt;: Bcrypt&lt;br /&gt;
* &amp;lt;code&amp;gt;$sha1$&amp;lt;/code&amp;gt;: SHA-1&lt;br /&gt;
* &amp;lt;code&amp;gt;$5$&amp;lt;/code&amp;gt;: SHA-256&lt;br /&gt;
* &amp;lt;code&amp;gt;$6$&amp;lt;/code&amp;gt;: SHA-512&lt;br /&gt;
&lt;br /&gt;
''' $2a$ '''&lt;br /&gt;
&lt;br /&gt;
The original specification did not define how to handle non-ASCII character, nor how to handle a null terminator. The specification was revised to specify that when hashing strings:&lt;br /&gt;
&lt;br /&gt;
* the string must be UTF-8 encoded&lt;br /&gt;
* the null terminator must be included&lt;br /&gt;
&lt;br /&gt;
With this change, the version was changed to &amp;lt;code&amp;gt;$2a$&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' $2x$, $2y$ (June 2011) '''&lt;br /&gt;
&lt;br /&gt;
In June 2011, a bug was discovered in '''crypt_blowfish''', a PHP implementation of BCrypt. It was mis-handling characters with the 8th bit set. They suggested that system administrators update their existing password database, replacing &amp;lt;code&amp;gt;$2a$&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;$2x$&amp;lt;/code&amp;gt;, to indicate that those hashes are bad (and need to use the old broken algorithm). They also suggested the idea of having '''crypt_blowfish''' emit &amp;lt;code&amp;gt;$2y$&amp;lt;/code&amp;gt; for hashes generated by the fixed algorithm.&lt;br /&gt;
&lt;br /&gt;
Nobody else, including canonical OpenBSD, adopted the idea of 2x/2y. This version marker change was limited to '''crypt_blowfish'''.&lt;br /&gt;
&lt;br /&gt;
''' $2b$ (February 2014) '''&lt;br /&gt;
&lt;br /&gt;
A bug was discovered in the OpenBSD implementation of bcrypt. They were storing the length of their strings in an '''unsigned char''' (''i.e.'' 8-bit &amp;lt;code&amp;gt;Byte&amp;lt;/code&amp;gt;). 		&lt;br /&gt;
&lt;br /&gt;
BCrypt was created for OpenBSD. When they had a bug in their library, they decided to bump the version number.&lt;br /&gt;
&lt;br /&gt;
==Bcrypt Algorithm==&lt;br /&gt;
&lt;br /&gt;
The bcrypt algorithm is the result of encrypting the text ''&amp;quot;OrpheanBeholderScryDoubt&amp;quot;'' 64 times using Blowfish. In bcrypt the usual Blowfish key setup function is replaced with an ''expensive'' key setup (EksBlowfishSetup) function:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''Function'''&amp;lt;/span&amp;gt; bcrypt&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''Input:'''&amp;lt;/span&amp;gt;&lt;br /&gt;
 cost: Number (4..31) &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;log&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;(Iterations). e.g. 12 ==&amp;gt; 2&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; = 4,096 iterations&amp;lt;/span&amp;gt;&lt;br /&gt;
 salt: array of Bytes (16 bytes) &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;random salt&amp;lt;/span&amp;gt;&lt;br /&gt;
 password: array of Bytes (1..72 bytes) &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;UTF-8 encoded password&amp;lt;/span&amp;gt;&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''Output:'''&amp;lt;/span&amp;gt; &lt;br /&gt;
 hash: array of Bytes (24 bytes)&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;//Initialize Blowfish state with expensive key setup algorithm&amp;lt;/span&amp;gt;&lt;br /&gt;
 ''state'' &amp;lt;math&amp;gt;\gets&amp;lt;/math&amp;gt; EksBlowfishSetup(''cost'', ''salt'', ''password'') &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;//Repeatedly encrypt the text &amp;quot;OrpheanBeholderScryDoubt&amp;quot; 64 times&amp;lt;/span&amp;gt;&lt;br /&gt;
 ''ctext'' &amp;lt;math&amp;gt;\gets&amp;lt;/math&amp;gt; &amp;lt;span style=&amp;quot;color: maroon&amp;quot;&amp;gt;''&amp;quot;OrpheanBeholderScryDoubt&amp;quot;''&amp;lt;/span&amp;gt; &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;//24 bytes ==&amp;gt; three 64-bit blocks&amp;lt;/span&amp;gt;&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''repeat'''&amp;lt;/span&amp;gt; (64)&lt;br /&gt;
 ''ctext'' &amp;lt;math&amp;gt;\gets&amp;lt;/math&amp;gt; EncryptECB(''state'', ''ctext'') &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;//encrypt using standard Blowfish in ECB mode&amp;lt;/span&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;//24-byte ''ctext'' is resulting password hash&amp;lt;/span&amp;gt;&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''return'''&amp;lt;/span&amp;gt; Concatenate(''cost'', ''salt'', ''ctext'')&lt;br /&gt;
&lt;br /&gt;
=== Bcrypt code – Expensive key setup ===&lt;br /&gt;
&lt;br /&gt;
The bcrypt algorithm depends heavily on its &amp;quot;Eksblowfish&amp;quot; key setup algorithm, which runs as follows:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''Function'''&amp;lt;/span&amp;gt; EksBlowfishSetup&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''Input:'''&amp;lt;/span&amp;gt;&lt;br /&gt;
 cost: Number (4..31) &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;log&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;(Iterations). e.g. 12 ==&amp;gt; 2&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; = 4,096 iterations&amp;lt;/span&amp;gt;&lt;br /&gt;
 salt: array of Bytes (16 bytes) &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;random salt&amp;lt;/span&amp;gt;&lt;br /&gt;
 password: array of Bytes (1..72 bytes) &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;UTF-8 encoded password&amp;lt;/span&amp;gt;&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''Output:'''&amp;lt;/span&amp;gt; &lt;br /&gt;
 state: opaque BlowFish state structure&lt;br /&gt;
 &lt;br /&gt;
 ''state'' &amp;lt;math&amp;gt;\gets&amp;lt;/math&amp;gt; InitialState()&lt;br /&gt;
 ''state'' &amp;lt;math&amp;gt;\gets&amp;lt;/math&amp;gt; ExpandKey(''state'', ''salt'', ''password'')&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''repeat'''&amp;lt;/span&amp;gt; (2&amp;lt;sup&amp;gt;''cost''&amp;lt;/sup&amp;gt;)&lt;br /&gt;
 ''state'' &amp;lt;math&amp;gt;\gets&amp;lt;/math&amp;gt; ExpandKey(state, 0, password)&lt;br /&gt;
 ''state'' &amp;lt;math&amp;gt;\gets&amp;lt;/math&amp;gt; ExpandKey(state, 0, salt)&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''return'''&amp;lt;/span&amp;gt; ''state''&lt;br /&gt;
&lt;br /&gt;
InitialState works as in the original Blowfish algorithm, populating the P-array and S-box entries with the fractional part of &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; in hexadecimal.&lt;br /&gt;
&lt;br /&gt;
=== Expand key ===&lt;br /&gt;
The ExpandKey function does the following:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''Function'''&amp;lt;/span&amp;gt; ExpandKey(''state'', ''salt'', ''password'')&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''Input:'''&amp;lt;/span&amp;gt;&lt;br /&gt;
 state: Opaque BlowFish state structure &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;Internally contains P-array and S-box entries&amp;lt;/span&amp;gt;&lt;br /&gt;
 salt: array of Bytes (16 bytes) &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;random salt&amp;lt;/span&amp;gt;&lt;br /&gt;
 password: array of Bytes (1..72 bytes) &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;UTF-8 encoded password&amp;lt;/span&amp;gt;&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''Output:'''&amp;lt;/span&amp;gt; &lt;br /&gt;
 state: opaque BlowFish state structure&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;//Mix password into the internal P-array of ''state''&amp;lt;/span&amp;gt;&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''for'''&amp;lt;/span&amp;gt; ''n'' &amp;lt;math&amp;gt;\gets&amp;lt;/math&amp;gt; 1 &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''to'''&amp;lt;/span&amp;gt; 18 &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''do'''&amp;lt;/span&amp;gt;&lt;br /&gt;
 P&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; &amp;lt;math&amp;gt;\gets&amp;lt;/math&amp;gt; P&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;xor&amp;lt;/span&amp;gt; ''password''[32(n-1)..32n-1] &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;//treat the password as cyclic&amp;lt;/span&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;//Encrypt state using the lower 8 bytes of salt, and store the 8 byte result in P&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;|P&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
 ''block'' &amp;lt;math&amp;gt;\gets&amp;lt;/math&amp;gt; Encrypt(''state'', ''salt''[0..63])&lt;br /&gt;
 P&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; &amp;lt;math&amp;gt;\gets&amp;lt;/math&amp;gt; ''block''[0..31] &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;//lower 32-bits&amp;lt;/span&amp;gt;&lt;br /&gt;
 P&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;lt;math&amp;gt;\gets&amp;lt;/math&amp;gt; ''block''[32..63] &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;//upper 32-bits&amp;lt;/span&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;//Continue encrypting state with salt, and storing results in remaining P-array&amp;lt;/span&amp;gt;&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''for'''&amp;lt;/span&amp;gt; ''n'' &amp;lt;math&amp;gt;\gets&amp;lt;/math&amp;gt; 2 &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''to'''&amp;lt;/span&amp;gt; 9 &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''do'''&amp;lt;/span&amp;gt;&lt;br /&gt;
 ''block'' &amp;lt;math&amp;gt;\gets&amp;lt;/math&amp;gt; Encrypt(''state'', ''block'' &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''xor'''&amp;lt;/span&amp;gt; ''salt''[64(n-1)..64n-1]) &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;//encrypt using the current key schedule and treat the salt as cyclic&amp;lt;/span&amp;gt;&lt;br /&gt;
 P&amp;lt;sub&amp;gt;2n-1&amp;lt;/sub&amp;gt; &amp;lt;math&amp;gt;\gets&amp;lt;/math&amp;gt; ''block''[0..31] &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;//lower 32-bits&amp;lt;/span&amp;gt;&lt;br /&gt;
 P&amp;lt;sub&amp;gt;2n&amp;lt;/sub&amp;gt; &amp;lt;math&amp;gt;\gets&amp;lt;/math&amp;gt; ''block''[32..63] &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;//upper 32-bits&amp;lt;/span&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;//Mix encrypted state into the internal S-boxes of ''state''&amp;lt;/span&amp;gt;&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''for'''&amp;lt;/span&amp;gt; ''i'' &amp;lt;math&amp;gt;\gets&amp;lt;/math&amp;gt; 1 &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''to'''&amp;lt;/span&amp;gt; 4 &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''do'''&amp;lt;/span&amp;gt;&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''for'''&amp;lt;/span&amp;gt; ''n'' &amp;lt;math&amp;gt;\gets&amp;lt;/math&amp;gt; 0 &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''to'''&amp;lt;/span&amp;gt; 127 &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''do'''&amp;lt;/span&amp;gt;&lt;br /&gt;
 ''block'' &amp;lt;math&amp;gt;\gets&amp;lt;/math&amp;gt; Encrypt(''state'', ''block'' &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''xor'''&amp;lt;/span&amp;gt; ''salt''[64(n-1)..64n-1]) &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;//as above&amp;lt;/span&amp;gt;&lt;br /&gt;
 S&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;[2n] &amp;lt;math&amp;gt;\gets&amp;lt;/math&amp;gt; ''block''[0..31] &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;//lower 32-bits&amp;lt;/span&amp;gt;&lt;br /&gt;
 S&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;[2n+1] &amp;lt;math&amp;gt;\gets&amp;lt;/math&amp;gt; ''block''[32..63] &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;//upper 32-bits&amp;lt;/span&amp;gt;&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: #004DBB;&amp;quot;&amp;gt;'''return'''&amp;lt;/span&amp;gt; ''state''&lt;br /&gt;
&lt;br /&gt;
Hence, &amp;lt;code&amp;gt;ExpandKey(''state'', 0, ''key'')&amp;lt;/code&amp;gt; is the same as regular Blowfish key schedule since all XORs with the all-zero salt value are ineffectual. &amp;lt;code&amp;gt;ExpandKey(''state'', 0, ''salt'')&amp;lt;/code&amp;gt; is similar, but uses the salt as a 128-bit key.&lt;br /&gt;
&lt;br /&gt;
==User input==&lt;br /&gt;
Many implementations of bcrypt truncate the password to the first 72 bytes.&lt;br /&gt;
&lt;br /&gt;
The mathematical algorithm itself requires initialization with 18 32-bit subkeys (equivalent to 72 octets/bytes). The original specification &amp;quot;The 448 [bit] limit on the key size ensures that the every bit of every subkey depends on every bit of the key.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Implementations have varied in their approach of converting passwords into initial numeric values, including sometimes reducing the strength of passwords containing non-ASCII characters.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Crypt (C)#Blowfish-based scheme]] crypt password storage and verification scheme Blowfish&lt;br /&gt;
* [[PBKDF2]] (Password-Based Key Derivation Function 2)&lt;br /&gt;
* [[Scrypt]]&lt;br /&gt;
* [[SHA-256]]&lt;br /&gt;
* [[SHA-1]]&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
[http://wikipedia.org/ http://wikipedia.org/]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
		
	</entry>
</feed>