Closed t00ny closed 5 years ago
require("crypt")
local rsa = crypt.RSA()
local prim = rsa:GeneratePrimaryKey(2048)
print(util.Base64Encode(prim))
local secn,err = rsa:GenerateSecondaryKey(prim)
print(secn,err)
This code snippet returns the following:
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDK436vPbLRgIFNzpQrcBgI
vzpqBMYRGhHGpJQUkY+tZHYK/PEMmgDXvACIUI12U0Cad+FRoduBK9Cw+5VOD4bYJVwVg484
vKfWIByueTgjOXX51uyR3bQCFC6doRH7T6H/EKkOFngqqC1me3WsM3UWiNTJQzKp3n06t0Q0
f0NJwjFvk9eI/9vQG/SOXvkhzQvEv65ssx4gpMXjqm9lq8u1i2HFNvG5uO1PoadF3E+RUM8Q
14L1SgsHO5IjiQ8o6yE7n5HAdEdFIWpjQl5dUIthNUkzZou/MoDoN5yVD27ZE1EtSJqiZ2B4
qVJITJ4XkyNyAFKSL4AKmvcOlHnMfRJVAgERAoIBAAjzcsP3bYk+I9J90dS9anjbQpO8ciZm
zBQOykwzmSmIMmJd+5NhJa8qLTMwuvJljiTus1owjXLgDPi/zh3L+qenS5eJkZzbJYWul9qF
WRCc41KNPySNi7TMLzuo/QdSknDmYc+uKvLStrV2Y08gY0iGCWM7b2lgZ2g8yonYcCUi13vO
C+TyZFNVfPBDJu8jNwWOWaxIEuhIMh/9Wj28sngXgxErOEdPZMV8hPPXYTt0K3Ydu6qYzMdN
cE9xHPtoUw9yuYZN50JZy/2PmlypDidV8QnJM3JplAQz2/rHNrZyHYcvONF2yUbzTHz2QIce
1zidTZY6SYP0AqkrAJ7VlAkCgYEA4yTQ7cHy8e4fP30kUUT6kPPkTmppU8B5sA5im5tacu/s
A/C7VbO8UeZEhj02CrzFCAmT2wDvLf1jCgNZt7kL0iUrjbqhZiXjm/GkrLg8NWgBmMZbt9rU
uCHDD0qTi4VhNwTv0wlFA1Lnd9Htn2wX/PcG+t1GaPRTqH27Hq1VYj0CgYEA5KnZ3CxBXSvA
T8tIirBe8P2WGhaSyHnGparZK6hG4M41GE9SoGBKWe0BW3GUU5DtQzyhtNl+ELmn68IrcS1N
SbhLlsxCZz9KaVORXBtxv9LtA486RcMErbyHvcDYYIGXfNrVFQ1Iit2MahCRSAoVbXe2eRJq
lLysZ5Zf97mT6fkCgYEAuw9Cpa7IEofdf5Q8BrFG0bnLE2axF8uvge26nkOz5i7+mdVO+0i5
NGNHfZvSJvXPcAfjLNOXy4VgntWVLeOvYcRB/D9XvYidUz94jj1ewpHjMoU8eUrNTFgKDJfE
zUCqaYuYU3ELqGJkRI7DsHci0FL2sHn9v9hE5Rw/vukZI7kCgYEArtw9L+WbZV2xLfXOD7QM
Xe8Ybk1/TgLFFUZp1hdFQn+SA4fz5A1mCIgQGMBEP+dMBj1smVsGDMo1HbKZsOZoR27QZEHY
bRJH9jDYkbqiR2UPmU9oy+98DGL+Y+3SpCbdQVwMW2SCxItNQgyrVTTjNZfHxf8GNYE4i3L+
F8ol0QkCgYEAoW4bGG6juWwvv6+CBA17EJpC2QR6p+gL1wvGTUC0kSLk6WExlTIuumeYRQt5
KtsuGGUes5rAlsIMYkaYmZiQA9eV7d7PpK+raQmnmLVetnEbe+9RZ4+Fmc+K4cTgxQwKNMy+
+FvgTYp1raxt5DSqbM/7+jWJhjuqpRJmfbRSJwQ=
nil BER decode error
For some reason, the RSA public key fails to generate and returns nothing alongside BER decode error
I believe this should be fixed on commit deedee5d71b4270ffbe0c99691dd989e2ff6ca85
Thanks a lot for making this, but I am confused on how it is supposed to be implemented into gLUA (I know how to import the module).
Would you mind providing a couple examples?