Coder Social home page Coder Social logo

ml_bcrypt's Introduction

ml_bcrypt - MTA bcrypt module

Bcrypt module for MTA:SA, for your passwords. Just three handy functions: bcrypt_digest, bcrypt_salt, and bcrypt_verify.

bcrypt will be added in the next MTA version as the passwordHash and passwordVerify functions.


Compiling

Windows

premake5.exe vs2015

The project files are available in Build/ then.

Linux

./premake5 gmake

# Use either of the following commands
make all # Builds all (both debug and release for x86 and x64 - you'll need gcc-multilib then, not recommended - use one of the commands below instead)
make config=release_x86 all # Release build for the x86 platform
make config=release_x64 all # Release build for the x86_64 platform

Documentation

bcrypt_digest

string bcrypt_digest(string key, string salt)

Returns the hash.

bcrypt_salt

string bcrypt_salt(int logRounds)

Please visit this link to determine the number of rounds appropriate for your server. Returns the salt.

bcrypt_verify

bool bcrypt_verify(string key, string digest)

Returns whether it is verified. How does it get the salt?

Example

Here's some code that explains the use of all these functions, remember that the database functions mentioned in this aren't real functions and are just for this demonstration.

-- Get this information by conventional means
myName = "qaisjp"
myRegisterPassword = "LoLIcon"

-- When registering
mySalt = bcrypt_salt(10000)
hashedPassword = bcrypt_digest(myRegisterPassword, mySalt)
savePasswordInDatabase(myName, hashedPassword)

-- Now I want to login
myLoginPassword = "LoLIcon"
if bcrypt_verify(hashedPasswordFromDatabase, myLoginPassword) then
    outputChatBox("Password verified")
end

ml_bcrypt's People

Contributors

ixjf avatar jushar avatar micechal avatar pzduniak avatar qaisjp avatar sbx320 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

sbx320

ml_bcrypt's Issues

Blowfish

Does this lib support 2a blowfish? I wish to use the password verify method that could use the 2a blowfish since the shitty mta api doesnt provide that.

Unable to load the module on Linux server

I just built this module without errors, and when trying to "attach" it to my MTA server running on 32 bit Debian Wheezy, it outputs this error:
MODULE: Unable to load modules/ml_bcrypt.so (/home/mtasa/mods/deathmatch/modules/ml_bcrypt.so: undefined symbol: crypt_rn)!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.