This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

encode-decode password in apps
#3
(10.10.2018, 16:47)admin Wrote: Docs: http://openrb.com/docs/lua.htm#encded-info

Thank you for your quick reply.

my task:
1. password must be encrypted by HW specific key (mac address)
2. aftter restore project on diferent HW, the password must not be visible. 
In my opinion I wish rsa function how to?

Thank you.

Code:
require('encdec')
password="1*1234"
key=io.readfile('/sys/class/net/eth0/address'):trim() -- or "/proc/device-tree/uniqid" or combination MAC and uniqid


-- encdec.md5(password)            -- get only hash md5
-- encdec.sha1(password)        -- get only hash sha1
-- encdec.crc16(password)        -- get crc
secret=encdec.base64enc(password)    -- ok but is not encription
pwd_decoded=encdec.base64dec(secret)    -- ok but is not encription



sha_secret=encdec.sha256(password)        -- undocumented ( create sha256 hash)
encoded_pwd=encdec.hmacsha256(password, key)    -- undocumented ( create signature with key), do you have any function to get data with key?
Reply


Messages In This Thread
encode-decode password in apps - by merel - 10.10.2018, 16:04
RE: encode-decode password in apps - by admin - 10.10.2018, 16:47
RE: encode-decode password in apps - by merel - 10.10.2018, 21:07
RE: encode-decode password in apps - by admin - 13.10.2018, 18:12
RE: encode-decode password in apps - by merel - 15.10.2018, 21:22
RE: encode-decode password in apps - by admin - 22.10.2018, 06:38
RE: encode-decode password in apps - by merel - 25.10.2018, 08:11

Forum Jump: