mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
ADD: aes128_encrypt ECB in scripting.c
ADD: aes128_decrypt ECB in scripting.c ADD: Sha1Hex method in utils.lua
This commit is contained in:
parent
ea75b30c81
commit
b18948fd92
2 changed files with 78 additions and 5 deletions
|
@ -101,7 +101,7 @@ local Utils =
|
|||
end,
|
||||
|
||||
------------ SHA1 hash
|
||||
-- Takes a hex string and calculates a SHA1 hash
|
||||
-- Takes a string and calculates a SHA1 hash
|
||||
Sha1 = function(s)
|
||||
if s == nil then return nil end
|
||||
if #s == 0 then return nil end
|
||||
|
@ -113,6 +113,19 @@ local Utils =
|
|||
end
|
||||
return nil
|
||||
end,
|
||||
-- Takes a hex string and calculates a SHA1 hash
|
||||
Sha1Hex = function(s)
|
||||
if s == nil then return nil end
|
||||
if #s == 0 then return nil end
|
||||
if type(s) == 'string' then
|
||||
local utils = require('utils')
|
||||
local asc = utils.ConvertHexToAscii(s)
|
||||
local hash = core.sha1(asc)
|
||||
return hash
|
||||
end
|
||||
return nil
|
||||
end,
|
||||
|
||||
|
||||
-- input parameter is a string
|
||||
-- Swaps the endianess and returns a number,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue