Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Releases Plugins [Plugin] SampBcrypt

 
  • 2 Vote(s) - 5 Average
Plugin SampBcrypt
SyS
Offline

Burgershot Member
Posts: 37
Threads: 5
Joined: Apr 2019
Reputation: 4
#1
2019-04-14, 07:41 AM (This post was last modified: 2019-05-07, 04:36 PM by SyS.)
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
  • Clone the repo

    git clone https://github.com/Sreyas-Sreelal/samp-bcrypt.git

  • Setup testing server

    make setup

  • Build using makefile

    make release for release builds

    make debug for debug builds

  • Run the tests

    make run
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);
    } 
Mugsy Away

Desarollador
Posts: 171
Threads: 10
Joined: Apr 2019
Reputation: 0
Location: Spain
#2
2019-04-14, 07:48 AM
I do not understand much, but I see that it's cool.
[Image: oN9R4KR.gif]
Shady
Offline

Burgershot Member
Posts: 10
Threads: 3
Joined: Mar 2019
Reputation: 1
Location: Egypt
#3
2019-04-14, 02:08 PM
What's the difference between your plugin and lassir's plugin?
[font=Trebuchet MS]Retired

Former developer @ Golden Gate RP, IV.Digital, Core:RP, OS:RP, SC:RP, NG:RP, OG:RP, CNRSF, and SWF.
[/font]
kristo
Offline

Burgershot Member
Posts: 47
Threads: 10
Joined: Feb 2019
Reputation: 7
Location: Estonia
#4
2019-04-14, 02:08 PM
(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.
Justus
Offline

Software Developer
Posts: 5
Threads: 1
Joined: Apr 2019
Reputation: 0
#5
2019-04-14, 09:58 PM
Thanks, makes it much easier with laravel sites.
SyS
Offline

Burgershot Member
Posts: 37
Threads: 5
Joined: Apr 2019
Reputation: 4
#6
2019-04-28, 05:00 AM
New version
https://github.com/Sreyas-Sreelal/samp-bcrypt/releases/tag/v0.2.0
hual
Offline

King

Posts: 106
Threads: 3
Joined: Feb 2019
Reputation: 7
Location: Bulgaria
#7
2019-05-01, 02:09 PM
Rust... safe...
Sasino97
Offline

Software Developer
Posts: 108
Threads: 16
Joined: Apr 2019
Reputation: 7
Location: Tampa, FL
#8
2019-06-11, 06:56 AM
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?
SynTacs
Offline

Burgershot Member
Posts: 25
Threads: 2
Joined: Jun 2019
Reputation: 0
Location: Philippines
#9
2019-06-17, 01:58 AM
Can you add inline capabilities?
PatrickGTR
Offline

Burgershot Member
Posts: 12
Threads: 3
Joined: Apr 2019
Reputation: 5
Location: UK
#10
2019-06-17, 02:55 PM
(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
SynTacs
Offline

Burgershot Member
Posts: 25
Threads: 2
Joined: Jun 2019
Reputation: 0
Location: Philippines
#11
2019-06-18, 01:59 AM (This post was last modified: 2019-06-19, 08:11 AM by SynTacs.)
(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.
SyS
Offline

Burgershot Member
Posts: 37
Threads: 5
Joined: Apr 2019
Reputation: 4
#12
2020-05-01, 03:53 AM
v0.2.2 released
https://github.com/Sreyas-Sreelal/samp-bcrypt/releases/tag/0.2.2
Y_Less
Offline

Administrator

Posts: 323
Threads: 16
Joined: Feb 2019
Reputation: 90
#13
2020-06-04, 10:19 PM
https://github.com/pawn-lang/YSI-Includes/blob/5.x/YSI_Coding/y_inline/features.md#bcrypt
SyS
Offline

Burgershot Member
Posts: 37
Threads: 5
Joined: Apr 2019
Reputation: 4
#14
2020-07-10, 02:02 PM
SA-MP bcrypt v0.2.3
https://github.com/Sreyas-Sreelal/samp-bcrypt/releases/tag/0.2.3
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode