0

I have a DB that has stored passwords that where encrypted using PHP's crypt function. I have found out that the crypt function actually uses bcrypt and i have found http://bcrypt.codeplex.com/ bcrypt is written in a very specific way with the BSD Base64 Alphabet not the regular Base64 Alphabet.

I'm hopping the Bcrypt.Net project emulates the PHP verion. but i don't know any thing about using DLLs in side of VBA and being able to access their function. And I don't know how to find the function inside the Dll that emulates the Bcrypt.

Im using the VBA inside Access 2010. Can anyone PLEASE HELP!

Erik A
  • 30,261
  • 11
  • 41
  • 58
  • How about this? http://www.di-mgt.com.au/cryptoBlowfishVer6.html – html_programmer Oct 24 '13 at 14:49
  • I don't think you'll be able to use BCrypt in Access unless that .DLL has specifically been written for COM consumers. Most .NET projects/DLL's haven't been written as COM Callable, unless that was a specific requirement when building the .DLL. This is because making DLL's in .NET so they are COM callable is not trivial. – HK1 Oct 25 '13 at 16:32

1 Answers1

0

I downloaded bcrypt.net from here Bcrypt.Net. To add dll file right click on project name and then select "References...". A window will open and then browse your dll file to insert. Then add the code as your need in you C# page.

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;
  }
}

and for php bcrypt you watch this link

Community
  • 1
  • 1
Subinoy
  • 438
  • 6
  • 22