RSA PKCS1PAD2 result not like OB1

ok am converting config from OB1 to OB2 but the problem is that “RSA PKCS1PAD2” Block in OB2 not showing the same result as OB1

OB2
1200px-LetterZ.svg

i tried to convert it to BASE64 but it doesn’t work

OB1 'OB1 result ’
Capture

is thare a right way to do this ?

Please can you give me the loliscript for OB1 and lolicode for OB2 that you’re using (assume the inputs are constant, do not give me the full config with requests etc i just want to know the pkcs1pad2 part). Do give me some sample input tho ^^

Yes sure
OB1

#K1 PARSE "<SOURCE>" LR "\"publickey_mod\":\"" "\"" -> VAR "K1" 

#K2 PARSE "<SOURCE>" LR "\"publickey_exp\":\"" "\"" -> VAR "K2" 

#RSA FUNCTION RSAPKCS1PAD2 "<K1>" "<K2>" "<PASS>" -> VAR "RSA" 

and this for OB2

BLOCK:Parse
LABEL:K1
  input = @data.SOURCE
  leftDelim = "\"publickey_mod\":\""
  rightDelim = "\""
  MODE:LR
  => VAR @K11
ENDBLOCK

BLOCK:Parse
LABEL:K2
  input = @data.SOURCE
  leftDelim = "\"publickey_exp\":\""
  rightDelim = "\""
  MODE:LR
  => VAR @K22
ENDBLOCK

BLOCK:ConstantString
  value = @input.PASSWORD
  => VAR @PS
ENDBLOCK

BLOCK:RSAPkcs1Pad2
  plainText = @PS
  modulus = @K11
  exponent = @K22
  => VAR @rSAPkcs1Pad2Output
ENDBLOCK

BLOCK:ByteArrayToBase64String
  bytes = @rSAPkcs1Pad2Output
  => VAR @BBB64
ENDBLOCK

that’s what you mean right ?

I meant that you should also give me some sample values of K1 and K2 and PASS, with the correct expected output of RSAPKCS1PAD2 on those inputs from OB1, so I have everything I need to debug this.

Modulus

b2e57ad93d6f2e3e856d30749f615c6be8987103db510e6cfd372c5bb228fb81205c27bbf63ff4d6a0963c40b93cd5d47781a0b817ec8698989de049148079e732aae3281b7b58cdb89412b91df6f3907f1ecc10bfa88f9d92554c3456ffcd082a0a1e1509611d71a160ac8d06490197fb444057303064586c399a367f4c49ca77e832e7d38b5149f73fd9300d8c59a23432a531f56c957f7cd3a68c3af3d90eda6b08208cc24ec67399f660db322f439eedd47e7cb74f50dc86754d971029658a5619985492f1acd8e758644c211afe993c62c9ea67398f574c9871f2bffe550abd78f897aa915f4db347e49422729e4c3ec11454bf4f91d61ed655acae23f1

Exponent

010001

PlainText

kepalsapi

RSA result

PQX5Ws/emUbZxbcU2Q0NC6iDwn2cLXklS5JSMTvzGgz5S2LT6v8//qXkXks07pZup4a8m5LrrFXGKHtMERc3iZuYytAdB2aT9ueYH4Da3moqTpzRCDL+hj3LYiyaTgFPNo8U65VGJ0TGRTT1tOQWMDX4ilcK5xSaWChJfD7/1xXRedMCnvgkjDb+JuktDu1DPvsGtd/W8ORSc+9DHATrwA9MOg5iYxV7p2O3YYppc/2yfNygOUJ3S7Hauzz6Wxe9GM274Rw9yqFEp2sEp1ne0pYlEYTXVkQLacMfJthkT2U8yhVPZzXTCOBdU4Jf/ckM3AlDPw914wz+UTthOyprDg==

Please refer to this issue on github for an explanation

I will commit the fix today.

1 Like

Thank you @Ruri :heart: i realy appreciate your support

Either build from source yourself or wait for build 0.1.27

1 Like