0

I code a Login so i need to Hash my Password whit BCrypt. I use the Nuget Package for BCrypt.Net-Next. i Follow the Tutorial to Hash the Passwort for the Login but i get a arror thet the assembly reference missing is. I try:

using BCrypt;
using BCrypt.Net;
using BCrypt.Net-Next; <- Is a Error 
using BCrypt.Net.Next;

Or install the Orginal BCrypt but that BCrypt is too Old for my Application

Nothing Work

So in the Tutorial from BCrypt.Net-Next you can use:

var a = BCrypt.HashPassword("StrnogPassword");

But if i use that i get the error CS0234 Missing Assembly Reference

Would be Awesome if someone can tell me how i use that Package for my Login. :)

Chieko
  • 11
  • 3

2 Answers2

0

Few checks

  1. What version of the framework you are using? Check-in Nuget description if it supports your version or not
  2. Dll missing or not? If it's there, try changing its property, Copy Local to true from the properties window.

Also, if you wish you can try EasyEncryption, I personally prefer Easy Encryption. I am not associated with this. This is just a recommendation.

Amit Ranjan
  • 212
  • 1
  • 11
  • My App is on .Net Core 3.1 and BCrypt-Next too. DLL is inside the Nuget Package but idk how i Call the DLL. The DLL name is BCrypt.Net-Next so i try to use the name from the DLL but it didnt work. I use BCrypt because the User can Register over my Webapplication and i crypt it with BCrypt – Chieko Nov 20 '20 at 19:17
  • BCrypt is the name of the class and you should use the same. For references you simply need using BCrypt.Net; Generally, the best way to use a dll is to first add its reference dll in prohject and then use any of its class in your code. The editor will show you a reference error and using the light bulb in the editor, it will automatically suggest the exact dll to refer. In some cases, it will show you some different dlls or packages. Hope this help. – Amit Ranjan Nov 23 '20 at 15:12
0

For anyone coming across this again, this line worked for me BCrypt.Net.BCrypt.HashPassword("my password");

You can also add using static BCrypt.Net.BCrypt; at the top and call HashPassword() directly.

Moaaz Assali
  • 147
  • 1
  • 8