Creating desktop or client-server database solutions?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
FourthWorld
- VIP Livecode Opensource Backer

- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
-
Contact:
Post
by FourthWorld » Sat Mar 11, 2017 12:21 am
mickpitkin92 wrote:I'm looking forward to seeing the messageDigest function get updated, hopefully it will have some clear documentation to help users figure out the correct syntax to generate say a SHA3 hash or other hash types.
The syntax noted in the pull request I linked to seems pretty straightforward for all types:
-
sphere
- Posts: 1145
- Joined: Sat Sep 27, 2014 10:32 am
Post
by sphere » Fri Mar 31, 2017 1:19 pm
Very nice.
I'm just stepping into this encryption bussiness.
I want to change a program whcih stores now plain text to a database. But it's better to change some sensitive data into encrypted data.
My idea was : encrypt--->Base64 encode--->store into database (base64 so it becomes a string instead of binarydata, so no hassle with trailing zeros as i have read here and there)
then Read again for DB -->Base64 decode--->decrypt
Have to test some things
-
sphere
- Posts: 1145
- Joined: Sat Sep 27, 2014 10:32 am
Post
by sphere » Thu Jun 15, 2017 9:03 pm
lc9 dp7 new sha released today

-
SirWobbyTheFirst
- VIP Livecode Opensource Backer

- Posts: 246
- Joined: Tue Jun 30, 2009 11:15 pm
Post
by SirWobbyTheFirst » Sun Nov 10, 2019 2:29 am
So looking at the MessageDigest function, it does indeed spit out a digest of the data, but I was wondering how I would go about converting that into the alphanumeric string that you would get from Mark Smith's library or PHP.
For example, if I put Hello World into an online SHA256 generator, I get the string "A591A6D40BF420404A011733CFB7B190D62C65BF0BCDA32B57B277D9AD9F146E" and I honestly cannot remember how to convert a digest to the necessary string. It used to be in the dictionary for MD5Digest but has been taken out now.
Mike
-
bogs
- Posts: 5480
- Joined: Sat Feb 25, 2017 10:45 pm
Post
by bogs » Sun Nov 10, 2019 2:42 am
Max's wiki still has it. I often find the wiki faster than the current dictionary and in many cases, it has additional information added for the entries (in this case, 2 comments go much further into it

).
Last edited by
bogs on Sun Nov 10, 2019 2:43 am, edited 1 time in total.
-
FourthWorld
- VIP Livecode Opensource Backer

- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
-
Contact:
Post
by FourthWorld » Sun Nov 10, 2019 2:42 am
LC returns the raw binary form of values returned from hashes, but you can transform binary data into hex with the binaryDecode function:
Code: Select all
on mouseup
put HexHash("Hello World", "sha-256")
end mouseup
function HexHash pStr, pHashMethod
put messageDigest(pStr, pHashMethod) into tmp
get binaryDecode("H*", tmp, tHex)
return tHex
end HexHash