I’m getting this error when trying to use RSA PKCS1PAD2 function

any help?

Create another string variable with constant block and assign the value of input.PASSWORD, you cannot pass input.PASSWORD directly to a block that takes a byte array currently because I didn’t implement automatic casting for those variables.


If you open an issue on github I will add it though, so please do


idk if I should make another thread, but look
I’m getting different output here and on OB1, ig it’s something about base64 n shit, but if ya can help I’d be grateful.
Output in OB1:

Output in OB2:


I think you should really post this stuff on github in the issue page instead of here


ye sure, but I don’t think it’s problem in OB2, I think I must be mistaken somewhere xDD

1 Like

If you used UTF8 → Base64
Try using Bytes → Base64


Screenshot (289)

Screenshot (291)

I am trying to encrypt RSA PKCS1PAD2 in version 1 and 2, but in version 2 it is encrypted differently and I do not know why. Both images are related to a target in different versions

Use bytes => base64 as suggested above.
Also read this How to work with byte arrays

Screenshot (291)

I do that, statistics do not change this form every time, and its form is different. This photo that I am posting is a form that should be created in version two, is there a way?
I also used Bytes => Base64 but the form of the encrypted phrase is different from the image I sent and is a longer expression

Then it means your input data must be wrong. Please provide the code for both OB1 and OB2 snippets so we can replicate.

V2 Code

  value = "c981c12828b1d4ddb09809528ee45e764d031a0311f91578a89926632423adf0fd781d10ce7e22ac89034c787ac0d270a660cfb982282fc9bf3e241b2b9ab494b54df8f09bd158e1492dceb0f6b02f0af1a7c57d2d0455987b63a2b6dd4546ffa8235ebf0e5f3391774c11ebdd4f0281149c6f0334684b47d8042305aae34f7bd46c0ea83b9f543b7f832caf39d8345aa682b1ba04a9d5c0578733c364fd04e59805324648813f2b599ccf4ecb81006f57a9530feb2089a1b8e7e2c09f83c6469df41401c3fd58d56c222bb3ad5145a807217eea52c9ebc6ad15a8b340d699a672b2b6b6d44259ab7ae49f5d620f90c64e364a4ce3e752469d91034104af05d7"
  => VAR @Modulus

  value = "010001"
  => VAR @Exponent

  value = "Sadegh123!@"

  plainText = @PASSWORDD
  modulus = @Modulus
  exponent = @Exponent
  => VAR @Rsa

  bytes = @Rsa
  => VAR @Byte_to_64


v1 Code

#Modulus FUNCTION Constant "c981c12828b1d4ddb09809528ee45e764d031a0311f91578a89926632423adf0fd781d10ce7e22ac89034c787ac0d270a660cfb982282fc9bf3e241b2b9ab494b54df8f09bd158e1492dceb0f6b02f0af1a7c57d2d0455987b63a2b6dd4546ffa8235ebf0e5f3391774c11ebdd4f0281149c6f0334684b47d8042305aae34f7bd46c0ea83b9f543b7f832caf39d8345aa682b1ba04a9d5c0578733c364fd04e59805324648813f2b599ccf4ecb81006f57a9530feb2089a1b8e7e2c09f83c6469df41401c3fd58d56c222bb3ad5145a807217eea52c9ebc6ad15a8b340d699a672b2b6b6d44259ab7ae49f5d620f90c64e364a4ce3e752469d91034104af05d7" -> VAR "Modulus" 

#Exponent FUNCTION Constant "010001" -> VAR "Exponent" 

#PASSWORDD FUNCTION Constant "Sadegh123!@" -> VAR "PASSWORDD" 

#Rsa FUNCTION RSAPKCS1PAD2 "<Modulus>" "<Exponent>" "<PASSWORDD>" -> VAR "Rsa" 


I know the value obtained changes every time, but the problem is that the form obtained is not like version 1 and target does not accept version 2 Form.

Can you please edit your post and use triple backquotes to post code according to the markdown syntax? ```

Like this (817 Bytes)

I do not understand what you mean, but if there is a problem while pasting the code from our conversation, use this txt file that I sent you. I used the same expressions in both versions to know that the obtained forms are not the same.

I edited your post, please next time do it like I did

Now can you tell me what the problem is?
Why version two form is different

The problem is that code should be written like that :] As for the actual problem, I don’t understand why you have empty inputs to the block in OB1

I think you do not understand the form encrypted in version two is different from version one. I sent you both codes, just start them once and see the result. I have selected all the items in both identical codes so that you can see and understand the result

You see what I mean? If you don’t put the triple backticks I cannot see that text (817 Bytes)

I uploaded a Zip file, download it and in the txt file you will see the free codes for each version, then run them in your respective version and see the form of the encrypted phrase in both. I put the same things in both codes so that the result is easy to understand.