SHA256

2014-12-15 Thread Richard Gaskin
LiveCode currently provides only two hashes, MD5 and SHA1.  I have a 
project in which I need SHA256.  Anyone here have a function for that?


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: SHA256

2014-12-15 Thread José Antonio Rocha
Hi!
There is this, but I could not make it work:
http://masmit.net/libhash-hmac.html

2014-12-15 17:25 GMT-02:00 Richard Gaskin ambassa...@fourthworld.com:

 LiveCode currently provides only two hashes, MD5 and SHA1.  I have a
 project in which I need SHA256.  Anyone here have a function for that?

 --
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  
  ambassa...@fourthworld.comhttp://www.FourthWorld.com

 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode



-- 
[image: Meira]
--
nome: José Antonio Meira da Rocha
https://plus.google.com/+JoséAntonioMeiradaRocha/
email: joseantonioro...@gmail.com
veículo: [ http://meiradarocha.jor.br ]
fones: [ 55-8448-3866  55-3744-2994 ]
--
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: SHA256

2014-12-15 Thread Richard Gaskin

José Antonio Rocha wrote:

2014-12-15 17:25 GMT-02:00 Richard Gaskin:

LiveCode currently provides only two hashes, MD5 and SHA1.  I have a
project in which I need SHA256.  Anyone here have a function for that?


Hi!
There is this, but I could not make it work:
http://masmit.net/libhash-hmac.html


Brilliant! Works great.

To make that lib work the only modification needed is to comment out the 
function definition for sha1digest, since that's now a built-in LiveCode 
function.


Using that lib I ran this:

 put sha256.hex(ambassa...@fourthworld.com)

...and verified it against OS X's implementation using a simple text 
file with the same string:


shasum -a 256 ~/Desktop/addy.txt

Both returned:

a14aa8957080619214e553cb552e7bf4bdbce216813d1bce2b50ea74a97a95e4

Another success story thanks to the late great Mark Smith.  Thanks for 
turning me onto that library.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: SHA256

2014-12-15 Thread Michael Doub

José,

I have not used these functions personally but I see in the readme that 
multiple steps are required for sha-256.


So, to get the sha-256 digest of a string:
put sha256.hex(the cat sat on the mat) into tDigest
put sha256.b64(someVariable) into tDigest

and of a file
put sha256.bin(/Users/yourusername/Desktop/somefile.txt, true) into 
tDigest


Hope this helps.
   Mike


On 12/15/14 2:42 PM, José Antonio Rocha wrote:

Hi!
There is this, but I could not make it work:
http://masmit.net/libhash-hmac.html

2014-12-15 17:25 GMT-02:00 Richard Gaskin ambassa...@fourthworld.com:

LiveCode currently provides only two hashes, MD5 and SHA1.  I have a
project in which I need SHA256.  Anyone here have a function for that?

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  
  ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode





___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: SHA256

2014-12-15 Thread José Antonio Rocha
2014-12-15 18:00 GMT-02:00 Michael Doub miked...@gmail.com:

 I have not used these functions personally but I see in the readme that
 multiple steps are required for sha-256.

 So, to get the sha-256 digest of a string:
 put sha256.hex(the cat sat on the mat) into tDigest
 put sha256.b64(someVariable) into tDigest

 and of a file
 put sha256.bin(/Users/yourusername/Desktop/somefile.txt, true) into
 tDigest


​Thank you, I will try this.​



-- 
[image: Meira]
--
nome: José Antonio Meira da Rocha
https://plus.google.com/+JoséAntonioMeiradaRocha/
email: joseantonioro...@gmail.com
veículo: [ http://meiradarocha.jor.br ]
fones: [ 55-8448-3866  55-3744-2994 ]
--
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode