MD5 Library

Anyone happen to know if we have a library available to us by default or will I have to load one ?

Thanks in advance.

I posted something earlier today that you can use:

http://forum.micasaverde.com/index.php/topic,29887.msg212089.html#msg212089

That helped tremendously (big thanks), after a few tweaks I have exactly what I needed to generate an MD5 auth. In the event someone else needs something like this I’ll post the adjustments. For those who may ask, I’m running UI5.


local user		= "username"
local pass		= "password"
local session		= "sessionID"
local auth		= nil

local function md5()
	local f = io.popen("echo -n '" .. auth .. "'  | openssl dgst -md5 -hex")
	if (f) then
		auth = f:lines()()
		f:close()
	end
	return auth
end

auth = user..":"..session..":"..pass
md5()
luup.log("MD5 Hash :"..auth)

[quote=“RichardTSchaefer, post:2, topic:185186”]I posted something earlier today that you can use:

http://forum.micasaverde.com/index.php/topic,29887.msg212089.html#msg212089[/quote]

And for those who want to extract the key do the following…

auth = string.sub(auth,-32)
luup.log(**debug.........The MD5 result: "..auth)

Enjoy