• 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Plugin] SampBcrypt
#1
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);

  Reply
#2
I do not understand much, but I see that it's cool.
[Image: oN9R4KR.gif]

Away
  Reply
#3
What's the difference between your plugin and lassir's plugin?
Retired



Former developer @ Golden Gate RP,?IV.Digital,?Core:RP,?OS:RP, SC:RP, NG:RP, OG:RP, CNRSF, and SWF.
  Reply
#4
(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.
  Reply
#5
Thanks, makes it much easier with laravel sites.
  Reply
#6
New version

https://github.com/Sreyas-Sreelal/samp-b...tag/v0.2.0
  Reply
#7
Rust... safe...
  Reply
#8
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?
  Reply
#9
Can you add inline capabilities?
  Reply
#10
(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-Include...L161-#L180
  Reply
#11
(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-Include...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.
  Reply
#12
v0.2.2 released

https://github.com/Sreyas-Sreelal/samp-b.../tag/0.2.2
  Reply
#13
https://github.com/pawn-lang/YSI-Include....md#bcrypt
  Reply
#14
SA-MP bcrypt v0.2.3

https://github.com/Sreyas-Sreelal/samp-b.../tag/0.2.3
  Reply
#15
SA-MP bcrypt v0.4.0

https://github.com/Sreyas-Sreelal/samp-b.../tag/0.4.0
  Reply


Forum Jump: