[Plugin] [REL] Encrypt
#1

Author:
Fro aka Fro1sha

Description:
Allows you to encrypt any text, file (_file).
Create a unique key (_hmac).

Dimension hash:
sha1 - 41
sha2(224, 256) - 65
sha2(384, 512) - 129
md5 - 33


Copyright © 2010 Fro <TBG>

Credit http://xyssl.sourcearchive.com/docum....9-2/main.html


Functions:
  • sha1(const text[], hash[])

  • sha1_file(const filename[], hash[])
    Return 0 if successful, 1 - if fopen failed or 2 - if fread failed


  • sha1_hmac(const key[], const text[], hash[])


  • sha2(const text[], hash[], sha2_method:method=sha_256)


  • sha2_file(const filename[], hash[], sha2_method:method=sha_256)


  • sha2_hmac(const key[], const text[], hash[], sha2_method:method=sha_256)


  • md5(const text[], hash[])


  • md5_file(const filename[], hash[])
    Return 0 if successful, 1 - if fopen failed or 2 - if fread failed


  • md5_hmac(const key[], const text[], hash[])

Encrypt Win+Unix
Source

P.S. On Linux it was not possible to check
Reply
#2

Amazing work dude, but I'm still going to use Whirlpool
Reply
#3

It's hash, not hesh.
Reply
#4

Quote:
Originally Posted by Woet
It's hash, not hesh.
ok, sorry
Reply
#5

nice one!

Quote:
Originally Posted by king s dm
Посмотреть сообщение
Amazing work dude, but I'm still going to use Whirlpool
agree with you dude
Reply
#6

solidfiles link has died, does anyone have a copy of this?

edit: nevermind, it seems to work for everyone but me :/
Reply
#7

Quote:
Originally Posted by JernejL
Посмотреть сообщение
solidfiles link has died, does anyone have a copy of this?
The link works just fine for me; I've attached the .rar archive to this post.
________
Bdsm Movies
Reply
#8

I use this plugin, it's great, but i wish it had more options - for example a simple native 32 bit crc or adler would be a good addition - it's not powerful, but it would be a fair bit faster than doing it in pawn and useful to detect spammers repeating same chat lines - by just a plugin-lightspeed crc check.
Reply
#9

indeed jernejl.

i still prefer adler to that indeed.
Reply
#10

Awesome dude, but I still prefer Whirlpool !
Nice job !
Reply
#11

Nice job, and you retards who keep saying "Nice job, I still prefer Whirlpool ." think if somone on your thread said "Nice, but I still prefer someone elses script"
Reply
#12

Please make ones for linux.. thats importent for me
Reply
#13

Thanks!!
Reply
#14

Whirlpool is good too.. Good choice with MD5.
Reply
#15

Nice
Reply
#16

There's a bug when I try to use sha2_hmac:
Код:
Erorr native function sha2_file: Expecting 3 parameter(s), but found 4
I think it's most definitely related to this piece of code:
Код:
AMX_NATIVE_INFO
    Encrypt_natives[] =
{
    { "sha1", n_sha1 },
    { "sha1_file", n_sha1_file },
    { "sha1_hmac", n_sha1_hmac },
    { "sha2", n_sha2 },
    { "sha2_file", n_sha2_file },
    { "sha2_hmac", n_sha2_file },
    { "md5", n_md5 },
    { "md5_file", n_md5_file },
    { "md5_hmac", n_md5_hmac },
    { 0, 0 }
};
Can you/someone fix it? I tried to compile it with code::blocks, but failed.
Reply
#17

Quote:
Originally Posted by Stylock
Посмотреть сообщение
There's a bug when I try to use sha2_hmac:
Код:
Erorr native function sha2_file: Expecting 3 parameter(s), but found 4
I think it's most definitely related to this piece of code:
Код:
AMX_NATIVE_INFO
    Encrypt_natives[] =
{
    { "sha1", n_sha1 },
    { "sha1_file", n_sha1_file },
    { "sha1_hmac", n_sha1_hmac },
    { "sha2", n_sha2 },
    { "sha2_file", n_sha2_file },
    { "sha2_hmac", n_sha2_file },
    { "md5", n_md5 },
    { "md5_file", n_md5_file },
    { "md5_hmac", n_md5_hmac },
    { 0, 0 }
};
Can you/someone fix it? I tried to compile it with code::blocks, but failed.
Use Visual C++ since it is a VisualStudio Project
Reply
#18

how to connect with website pcp if i wanna login?

example with whirlpool, use wp_hash
PHP код:
<?php
    session_start
();
    include 
"koneksi.php";
    if(isset(
$_SESSION['playername']))
    {
        
go('index.php''You already logged in.');
    }
    if(!isset(
$_POST['username'], $_POST['password']))
    {
        
go('index.php''Please fillout all required forms.');
    }
    else
    {
        
$query $koneksi->prepare("SELECT `adminlevel`,`name` from `players` where `name` = ? and `pass` = ?");
        
$query->execute(array($_POST['username'], strtoupper(hash("whirlpool"$_POST['password']))));
        if(
$query->rowCount() > 0)
        {
            
$data $query->fetch();
            
go('index.php''Succesfully logged in.');
            
$_SESSION['playername'] = $data['name'];
            
$_SESSION['playerlevel'] = $data['adminlevel'];
        }
        else
        {
            
go('index.php''Wrong username or password.');
        }
    }
Reply
#19

Quote:
Originally Posted by DandyCorleone
Посмотреть сообщение
how to connect with website pcp if i wanna login?

example with whirlpool, use wp_hash
It depends on which function you are using.
Here is list for in-game function and corresponding php function :

sha1(const text[], hash[]) - hash("sha1", $password)
sha2(const text[], hash[]) - hash("sha256", $password)
md5(const text[], hash[]) - hash("md5", $password) (Not recommended to use this now)

Out of above three hashing algorithms sha2 is most secure BUT now sa-mp has native function for sha-256 hash( https://sampwiki.blast.hk/wiki/SHA256_PassHash ) so if you want to use sha256 use the native function.

However whirlpool is still better than the above hash algorithms.
Reply
#20

Amazing!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)