10.10.2018, 21:07
(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?