资源简介
代码片段和文件信息
// Copyright (c) 2006 Damien Miller
//
// Permission to use copy modify and distribute this software for any
// purpose with or without fee is hereby granted provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED “AS IS“ AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL DIRECT INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE DATA OR PROFITS WHETHER IN AN
// ACTION OF CONTRACT NEGLIGENCE OR OTHER TORTIOUS ACTION ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
package bcrypt_jruby;
import java.io.UnsupportedEncodingException;
import java.security.SecureRandom;
/**
* BCrypt implements OpenBSD-style Blowfish password hashing using
* the scheme described in “A Future-Adaptable Password Scheme“ by
* Niels Provos and David Mazieres.
*
* This password hashing system tries to thwart off-line password
* cracking using a computationally-intensive hashing algorithm
* based on Bruce Schneier‘s Blowfish cipher. The work factor of
* the algorithm is parameterised so it can be increased as
* computers get faster.
*
* Usage is really simple. To hash a password for the first time
* call the hashpw method with a random salt like this:
*
*
* String pw_hash = BCrypt.hashpw(plain_password BCrypt.gensalt());
*
*
* To check whether a plaintext password matches one that has been
* hashed previously use the checkpw method:
*
*
* if (BCrypt.checkpw(candidate_password stored_hash))
* System.out.println(“It matches“);
* else
* System.out.println(“It does not match“);
*
*
* The gensalt() method takes an optional parameter (log_rounds)
* that determines the computational complexity of the hashing:
*
*
* String strong_salt = BCrypt.gensalt(10)
* String stronger_salt = BCrypt.gensalt(12)
*
*
* The amount of work increases exponentially (2**log_rounds) so
* each increment is twice as much work. The default log_rounds is
* 10 and the valid range is 4 to 31.
*
* @author Damien Miller
* @version 0.2
*/
public class BCrypt {
// BCrypt parameters
private static final int GENSALT_DEFAULT_LOG2_ROUNDS = 10;
private static final int BCRYPT_SALT_LEN = 16;
// Blowfish parameters
private static final int BLOWFISH_NUM_ROUNDS = 16;
// Initial contents of key schedule
private static final int P_orig[] = {
0x243f6a88 0x85a308d3 0x13198a2e 0x03707344
0xa4093822 0x299f31d0 0x082efa98 0xec4e6c89
0x452821e6 0x38d01377 0xbe5466cf 0x34e90c6c
0xc0ac29b7 0xc97c50dd 0x3f84d5b5 0xb5470917
0x9216d5d9 0x8979fb1b
};
private static final
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 108 2017-03-29 17:58 arachni\arachni-1.5.1-0.5.12-windows-x86_64\bin\arachni.bat
文件 108 2017-03-29 17:58 arachni\arachni-1.5.1-0.5.12-windows-x86_64\bin\arachni_console.bat
文件 108 2017-03-29 17:58 arachni\arachni-1.5.1-0.5.12-windows-x86_64\bin\arachni_multi.bat
文件 108 2017-03-29 17:58 arachni\arachni-1.5.1-0.5.12-windows-x86_64\bin\arachni_reporter.bat
文件 108 2017-03-29 17:58 arachni\arachni-1.5.1-0.5.12-windows-x86_64\bin\arachni_reproduce.bat
文件 108 2017-03-29 17:58 arachni\arachni-1.5.1-0.5.12-windows-x86_64\bin\arachni_restore.bat
文件 108 2017-03-29 17:58 arachni\arachni-1.5.1-0.5.12-windows-x86_64\bin\arachni_rest_server.bat
文件 108 2017-03-29 17:58 arachni\arachni-1.5.1-0.5.12-windows-x86_64\bin\arachni_rpc.bat
文件 108 2017-03-29 17:58 arachni\arachni-1.5.1-0.5.12-windows-x86_64\bin\arachni_rpcd.bat
文件 108 2017-03-29 17:58 arachni\arachni-1.5.1-0.5.12-windows-x86_64\bin\arachni_rpcd_monitor.bat
文件 108 2017-03-29 17:58 arachni\arachni-1.5.1-0.5.12-windows-x86_64\bin\arachni_sc
文件 141 2017-03-29 17:58 arachni\arachni-1.5.1-0.5.12-windows-x86_64\bin\arachni_shell.bat
文件 139 2017-03-29 17:58 arachni\arachni-1.5.1-0.5.12-windows-x86_64\bin\arachni_web.bat
文件 127 2017-03-29 17:58 arachni\arachni-1.5.1-0.5.12-windows-x86_64\bin\arachni_web_change_password.bat
文件 123 2017-03-29 17:58 arachni\arachni-1.5.1-0.5.12-windows-x86_64\bin\arachni_web_create_user.bat
文件 118 2017-03-29 17:58 arachni\arachni-1.5.1-0.5.12-windows-x86_64\bin\arachni_web_import.bat
文件 123 2017-03-29 17:58 arachni\arachni-1.5.1-0.5.12-windows-x86_64\bin\arachni_web_scan_import.bat
文件 116 2017-03-29 17:58 arachni\arachni-1.5.1-0.5.12-windows-x86_64\bin\arachni_web_sc
文件 139 2017-03-29 17:58 arachni\arachni-1.5.1-0.5.12-windows-x86_64\bin\arachni_web_task.bat
文件 6390 2017-03-29 17:58 arachni\arachni-1.5.1-0.5.12-windows-x86_64\LICENSE.txt
文件 1908 2017-03-29 17:58 arachni\arachni-1.5.1-0.5.12-windows-x86_64\README.txt
文件 1562 2017-03-29 17:51 arachni\arachni-1.5.1-0.5.12-windows-x86_64\system\arachni-ui-web\.gitignore
文件 232 2017-03-29 17:51 arachni\arachni-1.5.1-0.5.12-windows-x86_64\system\arachni-ui-web\.jrubyrc
文件 3338 2017-03-29 17:51 arachni\arachni-1.5.1-0.5.12-windows-x86_64\system\arachni-ui-web\app\assets\images\favicon.png
文件 12661 2017-03-29 17:51 arachni\arachni-1.5.1-0.5.12-windows-x86_64\system\arachni-ui-web\app\assets\ja
文件 1920 2017-03-29 17:51 arachni\arachni-1.5.1-0.5.12-windows-x86_64\system\arachni-ui-web\app\assets\ja
文件 496 2017-03-29 17:51 arachni\arachni-1.5.1-0.5.12-windows-x86_64\system\arachni-ui-web\app\assets\ja
文件 496 2017-03-29 17:51 arachni\arachni-1.5.1-0.5.12-windows-x86_64\system\arachni-ui-web\app\assets\ja
文件 5948 2017-03-29 17:51 arachni\arachni-1.5.1-0.5.12-windows-x86_64\system\arachni-ui-web\app\assets\ja
文件 2190 2017-03-29 17:51 arachni\arachni-1.5.1-0.5.12-windows-x86_64\system\arachni-ui-web\app\assets\ja
............此处省略19535个文件信息
- 上一篇:kepserverEX绿色
- 下一篇:threejs 天空盒 50+
评论
共有 条评论