![]() |
encode-decode password in apps - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: encode-decode password in apps (/showthread.php?tid=1643) |
encode-decode password in apps - merel - 10.10.2018 Hello, i need encode/decode password from alarm system in my apps (variable in storage) by MAC addr. Is supported any sha or md5 encode/decode in encdec library? or how to use libcrypt.so ??? over ffi? how? I apologize for my bad English and thank you. MEREL RE: encode-decode password in apps - admin - 10.10.2018 Docs: http://openrb.com/docs/lua.htm#encded-info RE: encode-decode password in apps - merel - 10.10.2018 (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') RE: encode-decode password in apps - admin - 13.10.2018 SHA/MD5 are one-way hashing algorithms, not suitable for two-way encryption/decryption. In your case probably some simple XOR can be used. Is the pin code always in 1 number + * + 4 numbers format? RE: encode-decode password in apps - merel - 15.10.2018 (13.10.2018, 18:12)admin Wrote: SHA/MD5 are one-way hashing algorithms, not suitable for two-way encryption/decryption. In your case probably some simple XOR can be used. Is the pin code always in 1 number + * + 4 numbers format? Hello admin, password is number of user + "*" + user password ( 4 or 8 digit ) for example: 2*1111 or 2*11112222 3*1111 or 3*11112222 Originally I wanted to use RSA encryption/decription but I did not find the solution in pure LUA. The second idea was to use openssl and os.execute but solution in lua is better. Thank you verry much. RE: encode-decode password in apps - admin - 22.10.2018 Create a user library called aes by using this code: https://github.com/openresty/lua-resty-string/blob/master/lib/resty/aes.lua Add this before ffi.cdef... (line 21) to make it work on LM: Code: local lib = '/usr/lib/libcrypto.so' Encrypted data is raw binary so it's additional encoded into base64. CPU unique ID is used instead of MAC address becase MAC can be changed on OS level while CPU ID cannot. Code: aes = require('aes') RE: encode-decode password in apps - merel - 25.10.2018 Thank Admi you very good help. Its work, thank you very much. |