-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aes-ecb-128 #42
Comments
base64 = {} local b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' -- You will need this for encoding/decoding -- encoding -- decoding local String = require("string"); local Array = require("lockbox.util.array"); local ECBMode = require("lockbox.cipher.mode.ecb"); local ZeroPadding = require("lockbox.padding.zero"); local AES128Cipher = require("lockbox.cipher.aes128"); function string.tohex(str) function string.fromhex(str) function aes_encode(str, key) local Index = string.len(str) / 16 if b == 0 then local cipher = ECBMode.Cipher() local cipherOutput = cipher print(cipherOutput) aes_encode("abcabcabcqweqweq", "abcabcabcqweqweq") --[[ local plainOutput = decipher --[[ <\�V�m�=�V�P�_� 16 <\�V�m�=�V�P�_�5���r�F�|92 |
lockbox/padding/pkcs7.lua
openssl:
str = abcabcabcqweqweq1234567890123456
key = abcabcabcqweqweq
aes:
<\�V�m�=�V�P�_㧼3��>yj���9�:�z5��rF�|92 ��2V
base64:
PFyEVsRtlT2wVqJQpV/jp7wzp/U+DHlq4g/zOc86zno1AP26cgBG33w5Mg3nEzJW
lockbox:
str = abcabcabcqweqweq1234567890123456
key = abcabcabcqweqweq
aes:
<\�V�m�=�V�P�_㧼3��>yj���9�:�z
base64:
PFyEVsRtlT2wVqJQpV/jp7wzp/U+DHlq4g/zOc86zno=
16的整数不匹配,补位正常,只有整数异常
The text was updated successfully, but these errors were encountered: