ID:1600974
 
(See the best response by A.T.H.K.)
Does anyone know where I can find a DLL/SO that returns a sha1 string?

I think that using the forums for game accounts is going to be easier on my users than using a website for game accounts and the forums separate.

However, our SMF forums uses sha1 and I'm unable to find a dll for it.
In response to A.T.H.K
A.T.H.K wrote:
http://www.mjtnet.com/plugins.htm

http://www.autoitscript.com/forum/topic/67245-sha1-dll-call/

It looks like it's made for another scripting language. O-o.

It says the second param for the function is the return_buffer. I have no idea what this means.

Is there also a linux version? Your hosting service is ran on linux, isn't it? I need something that's compatible with both windows and linux. It should also work with Byond.

If I am missing something, may I please have an example?

Here is my attempt at it as well-- Although, this causes the game to crash. I'm going to assume it has to do with the second argument not being given a value?

proc/SHA1(hash as text)
return call("HashLib.dll","StringSHA1")(hash)

//Called where appropriate
var/PassHash=SHA1("[lowertext(Entered_ID)][Entered_Pass]")

I'm hoping something like this will work

proc/SHA1(hash as text)
return call("HashLib.dll","int","StringSHA1",hash,0)
In response to A.T.H.K
A.T.H.K wrote:
I'm hoping something like this will work

> proc/SHA1(hash as text)
> return call("HashLib.dll","int","StringSHA1",hash,0)
>


DM's call function only takes two arguments at max. :<
Seems I've wasted your time then... sorry about that!
In response to A.T.H.K
A.T.H.K wrote:
Seems I've wasted your time then... sorry about that!

No, it's quite okay. At least you tried, thank you! :3
Best response
If you're using Linux, you could do something like this

mob/verb
Test()
var/fileName = rand(0,99999)
shell("echo -n password | sha1sum | awk '{print $1}' > [fileName].txt")// Because shell() won't return back to BYOND you must save the results into a file first.. sadly..
var/result = file2text("[fileName].txt")// read file
world << "test - [result]" // print file's contents
fdel("[fileName].txt")// remove file.


It's just an example.. may not work :)
In response to A.T.H.K
A.T.H.K wrote:
If you're using Linux, you could do something like this

> mob/verb
> Test()
> var/fileName = rand(0,99999)
> shell("echo -n password | sha1sum | awk '{print $1}' > [fileName].txt")// Because shell() won't return back to BYOND you must save the results into a file first.. sadly..
> var/result = file2text("[fileName].txt")// read file
> world << "test - [result]" // print file's contents
> fdel("[fileName].txt")// remove file.
>

It's just an example.. may not work :)

Thanks for the extra tip, I'll take a look into it tonight. This could potentially serve as a temp solution until I get out the books and dive into creating my own SO/DLL in C++.

Although I could have sworn I read somewhere or was told that I'd need to use C for it to work--

I'll make another post and confirm if I can get this working. Sadly I didn't know linux was capable of hashing from the shell.

Thanks again, :).

Anyone else is free to throw suggestions at me.

I know Murrawhip created one for SHA256 and that worked flawlessly. I was going to try and recompile a new version based off his found on Github but I always have a hard time getting the linker setup. Visual Studio makes me cry sometimes. T_T
Your option for linux works wonderfully! Thank you! :3
I apologize for the late reply on this but the crypto++ library was compiled in VS6 and I don't know how to upgrade it without errors but if you have a copy of VS6, you can create what you need. I will release a DLL that has all the hashing algs of the crypto++ library so you can just use
SHA256(string)
SHA1(string)


etc.
SHA1, SHA224, SHA256, SHA384, and SHA512 included.

Download cryptoBYOND