我有一个数据库,它存储了使用PHP加密函数加密的密码。我发现密码函数实际上使用bcrypt,我发现http://bcrypt.codeplex.com/ bcrypt是用BSD Base64字母表编写的,而不是普通的Base64字母表。
我跳过了Bcrypt.Net项目,模仿PHP。但是我不知道如何在VBA中使用DLL并能够访问它们的功能。我不知道如何在Dll中找到模仿Bcrypt的函数。
我使用的VBA内部访问2010。有人能帮忙吗!
发布于 2014-07-08 10:44:37
我从这里下载了bcrypt.net,Bcrypt.Net。要添加dll文件,右键单击项目名称上的"References...".,然后选择一个窗口将打开,然后浏览您的dll文件插入。然后根据您的需要在C#页面中添加代码。
using BCrypt;
public partial class your_class_name : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string salt = BCrypt.Net.BCrypt.GenerateSalt(); //Generate Salt
string hash = BCrypt.Net.BCrypt.HashPassword("subinoy", salt); //Using salt to generate password
if(BCrypt.Net.BCrypt.Verify("username","$2a$10$ljfI1o3m3gI.rXDpDkGc/ebUNqHKJ22EhJrQJnuoe3yAf58QoZW6i")) //this hash inside the if() will be taken from the database when the user registered
bcrypttext.Text = "equals";
else
bcrypttext.Text = "Not equal" + hash;
}
}对于bcrypt,您可以查看此链接
https://stackoverflow.com/questions/19567867
复制相似问题