RSA Encryption



  • hello guys
    I need RSA encryption code I have also looked at OB source code but I'm unable to figure it out I need the only function where I could provide module and exponent I hope somebody will reply to me.
    Here is my code

    Public Function RSAEnCrypt(ByVal dataToEncrypt As String, ByVal RSAKeyInfo As RSAParameters, ByVal doOAEPPadding As Boolean) As String
            Dim RSA As RSACryptoServiceProvider = New RSACryptoServiceProvider
            RSA.ImportParameters(RSAKeyInfo)
            Return Convert.ToBase64String(RSA.Encrypt(Convert.FromBase64String(dataToEncrypt), doOAEPPadding))
        End Function
    
    Dim pKey As String = "ce4bf5f5bb468d78de932c7885bcf505f6873df47cf2a83af11363594a2bce2615dd0697b4c842e251e196fb3ce9770ca0add5306adcaa3bc2548e3b8b6cc883729a299aa1a9b9b4ffc0f52bac66d5b1d9bc56ccba714b3b752443543b8cc0059ed43e5813e6f65e9ab3a60440f2d0867dab25d160cd0af78afaf60ab1bb7b517102a305940aaa14385c5dba3a397c7f0699da141ed1caa8d7bbea493d68fe6ae996e35ac6c7b180514902f32d9c2870e95098cd97ce6f5c671418a3392cdecfdc9b1f958903fddcdaff4c71684b58df234d3d08ec9a093842b9cd23d5601228c61005d242de27887bd219e013c6676e0a542d40ae56cab97a15902e1d1736e7"
            Dim exKey As String = "010001"
            Dim user As String = "asdasdasd"
            Dim rsaP As RSAParameters = New RSAParameters
            rsaP.Modulus = Encoding.UTF8.GetBytes(pKey)
            rsaP.Exponent = Encoding.UTF8.GetBytes(exKey)
    
            TextBox3.Text = RSAEnCrypt(user, rsaP, True)
    


  • SET  VAR  "PUBLICKEY" "ce4bf5f5bb468d78de932c7885bcf505f6873df47cf2a83af11363594a2bce2615dd0697b4c842e251e196fb3ce9770ca0add5306adcaa3bc2548e3b8b6cc883729a299aa1a9b9b4ffc0f52bac66d5b1d9bc56ccba714b3b752443543b8cc0059ed43e5813e6f65e9ab3a60440f2d0867dab25d160cd0af78afaf60ab1bb7b517102a305940aaa14385c5dba3a397c7f0699da141ed1caa8d7bbea493d68fe6ae996e35ac6c7b180514902f32d9c2870e95098cd97ce6f5c671418a3392cdecfdc9b1f958903fddcdaff4c71684b58df234d3d08ec9a093842b9cd23d5601228c61005d242de27887bd219e013c6676e0a542d40ae56cab97a15902e1d1736e7"
    
    FUNCTION RSAPKCS1PAD2 "<PUBLICKEY>" "010001" "<PASS>" -> VAR "PASSENCRYPTED" 
    
    FUNCTION URLEncode "<PASSENCRYPTED>" -> VAR "PASSENCRYPTEDURLENC" 
    
    


  • @mega_1 I want to implement in in VB not in OB



  • @King_Kong well I guess u are asking in the wrong forum



  • @mega_1 Maybe developer knows it


  • Admin

    I don't know VB, sorry. Anyways, look at the RSAPKCS1PAD2 function and implement that plus any other function that it calls and also data structures. It shouldn't be hard.



  • @Ruri Thanks for reply


Log in to reply