open.mp forum
[Plugin] SampBcrypt - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Releases (https://forum.open.mp/forumdisplay.php?fid=13)
---- Forum: Plugins (https://forum.open.mp/forumdisplay.php?fid=32)
---- Thread: [Plugin] SampBcrypt (/showthread.php?tid=136)



SampBcrypt - SyS - 2019-04-14

SampBcrypt

[Image: samp-bcrypt.svg?branch=master] [Image: 5rq55kukvy8xymly?svg=true] [Image: sampctl-SampBcrypt-2f2f2f.svg] [Image: samp-bcrypt.svg] [Image: samp-bcrypt.svg] [Image: samp-bcrypt.svg]

A bcrypt plugin for samp in Rust.

Installation

sampctl

If you are a sampctl user

sampctl p install Sreyas-Sreelal/samp-bcrypt

OR
  • Download suitable binary files from releases for your operating system
  • Add it your plugins folder
  • Add samp_bcrypt to server.cfg or? samp_bcrypt.so (for linux)
  • Add samp_bcrypt.inc in includes folder
Building
API
  • bcrypt_hash(playerid,callback[],input[],cost)
    • playerid - id of the player
    • callback[] - callback to execute after hashing
    • input[] - string to hash
    • cost - work factor (4 - 31)
  • Example

    PHP Code:
    main(){
     
    bcrypt_hash(0,"OnPassswordHash","text",12);
    }


    forward OnPassswordHash(playerid);
    public 
    OnPassswordHash(playerid){
     
    //hashing completed


  • bcrypt_get_hash(dest[],size = sizeof(hash))
    • dest[] - string to store hashed data
    • size - max size of dest string
  • Example

    PHP Code:
    main(){
     
    bcrypt_hash(0,"OnPassswordHash","text",12);
    }


    forward OnPassswordHash(playerid);
    public 
    OnPassswordHash(playerid){
     new 
    dest[250];
     
    bcrypt_get_hash(dest);
     
    printf("hash : %s",dest);


  • bcrypt_verify(playerid,callback[],input[],hash[])
    • playerid - id of the player
    • callback[] - callback to execute after hashing
    • input[] - text to compare with hash
    • hash[] - hash to compare with text
  • Example

    PHP Code:
    main(){
     
    bcrypt_hash(0,"OnPassswordHash","text",12);
    }


    forward OnPassswordHash(playerid);
    public 
    OnPassswordHash(playerid){
     new 
    dest[250];
     
    bcrypt_get_hash(dest);
     
    bcrypt_verify(playerid,"OnPassswordVerify","text",dest);
    }


    forward OnPassswordVerify(playerid,bool:success);
    public 
    OnPassswordVerify(playerid,bool:success){
     
    //success denotes verifying was successful or not
     
    if(success){
     
    //verfied
     
    } else{
     
    //hash doesn't match with text
     
    }


  • bcrypt_set_thread_limit(value)
    • value - number of worker threads at a time
  • Example

    PHP Code:
    main(){
     
    bcrypt_set_thread_limit(3);




RE: SampBcrypt - Mugsy - 2019-04-14

I do not understand much, but I see that it's cool.


RE: SampBcrypt - Shady - 2019-04-14

What's the difference between your plugin and lassir's plugin?


RE: SampBcrypt - kristo - 2019-04-14

(2019-04-14, 02:08 PM)Shady Wrote: What's the difference between your plugin and lassir's plugin?



This one's actually being maintained.


RE: SampBcrypt - Justus - 2019-04-14

Thanks, makes it much easier with laravel sites.


RE: SampBcrypt - SyS - 2019-04-28

New version

https://github.com/Sreyas-Sreelal/samp-bcrypt/releases/tag/v0.2.0


RE: SampBcrypt - hual - 2019-05-01

Rust... safe...


RE: SampBcrypt - Sasino97 - 2019-06-11

I think I was already using this as my bcrypt plugin, but I will double-check when at home.

Also, why "Passsword" with 3 Ss?


RE: SampBcrypt - SynTacs - 2019-06-17

Can you add inline capabilities?


RE: SampBcrypt - PatrickGTR - 2019-06-17

(2019-06-17, 01:58 AM)SynTacs Wrote: Can you add inline capabilities?



If you're implying y_inline, there's already one.



https://github.com/pawn-lang/YSI-Includes/blob/5.x/YSI_Coding/y_inline/y_inline_extra.inc#L161-#L180


RE: SampBcrypt - SynTacs - 2019-06-18

(2019-06-17, 02:55 PM)PatrickGTR Wrote:
(2019-06-17, 01:58 AM)SynTacs Wrote: Can you add inline capabilities?



If you're implying y_inline, there's already one.



https://github.com/pawn-lang/YSI-Includes/blob/5.x/YSI_Coding/y_inline/y_inline_extra.inc#L161-#L180



hmmmm... can I use that with sreyas's bcrypt?



Edit:

Just looked into the code of y_inline_extra is not related to sreyas, the thing I meant is that just like how a_mysql_inline works, it works under y_inline but is specifically created for the sole purpose of mysql_inline



Edit 2:

Inline is good but I think not that good seeing that the project is just a small, but commendable, project...



Edit 3:

if my instinct is right someone, a newbie perhaps, will pull out a why is it slow card...



ByCrypt hash is supposed to be slow to the purpose of being slow. More hashing means harder decryption.


RE: SampBcrypt - SyS - 2020-05-01

v0.2.2 released

https://github.com/Sreyas-Sreelal/samp-bcrypt/releases/tag/0.2.2


RE: SampBcrypt - Y_Less - 2020-06-04

https://github.com/pawn-lang/YSI-Includes/blob/5.x/YSI_Coding/y_inline/features.md#bcrypt


RE: SampBcrypt - SyS - 2020-07-10

SA-MP bcrypt v0.2.3

https://github.com/Sreyas-Sreelal/samp-bcrypt/releases/tag/0.2.3


RE: SampBcrypt - SyS - 2023-03-17

SA-MP bcrypt v0.4.0

https://github.com/Sreyas-Sreelal/samp-bcrypt/releases/tag/0.4.0