Code Monkey home page Code Monkey logo

lsl-hmac-sha1-fast's Introduction

LSL-HMAC-SHA1-Fast

Fast LSL HMAC-SHA1 with global pads.

This is a Linden Scripting Language HMAC-SHA1 hashing algorithm. I made it because the existing ones out there were too slow. This one is much faster because it heeds this advice given in RFC 2104:

"These intermediate results are stored and then used to initialize the IV of H each time that a message needs to be authenticated." http://tools.ietf.org/html/rfc2104, p. 3

Use the first user function in the script to sign your requests. Add a communications event to talk to this script from your other scripts. This has been tested to work.

lsl-hmac-sha1-fast's People

Contributors

gistya avatar

Watchers

 avatar James Cloos avatar

lsl-hmac-sha1-fast's Issues

A few questions

It states in the readme that "This has been tested to work.", yet I can't seem to generate an HMAC hash that matches existing generators.
I used this to test the output with the message digest set to SHA1. The secret key I'm using is de5868364551a577acc1ed9e276ce7a7 the test message is Hello, Avatar!.
The website indicates that the HMAC will be f2299a4d48b89817ab87d84fb2b2ad3c60980ad7 but this script is giving me 7urZ3pGzQOVFOns1HixWiWnjtm0 a completely different length and hash all together.
Now I noticed the script says "length = 40 GET FROM READER SCRIPT/NOTECARD" but I haven't found an HMAC hashing function that can't take a variable length, even the website I used indicates "This [secret] key will vary in length depending on the algorithm that you use.".
Regardless, I tried padding the key until it was 40 chars long and tested again. Still it generated a completely different hash than the site. I even compared using a php, java, and python HMAC hashing function set to SHA1 and they all matched the sites hash but this script doesn't seem to.
Am I doing something wrong to get these different results?

Also since SHA1 is prone to length extension attacks and had the first public collision published on 2/23/2017, will you ever make a 256 version? Even certain frameworks I use won't allow HMAC signing with SHA1 for security reasons. So this would be beneficial to have at some point for many people.

Caveat: The script doesn't compile because "skey=YOURSECRETKEYHERE" needs the quotes escaped. The A variable doesn't get defined anywhere even though the dataserver event loads it. Also, in the 4 years this script has been up llXorBase64StringsCorrect was deprecated for llXorBase64.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.