Code Monkey home page Code Monkey logo

rsa-via-openssl-libeay32's Issues

publickey decrypt error

private key (512 bit);

-----BEGIN RSA PRIVATE KEY-----
MIIBOgIBAAJBAMUVTgdp73c0YeU5fItHsNiNINsF6zJjZSCjIvOxBoBrtxzwL2Pe
4IMDjX2m+YShHNdikcIVkB9kIQg6u77z4m8CAwEAAQJBAKmKTFfAYApR+60vqN5A
S/feYFdKXiw4qTRMYrL0pL0vafXdERhnISID2XODy6epQ1N24z9eeRRLVUebIvad
PvECIQDnNFgn+a99ouvKL9dx5jk+Dch+j5efAe5qWry2nI4U3QIhANo4K77GGThi
+xhIcBPJNkfNprjs5rkKxKJd+OZnTGm7AiAM2hkIZ9W8eyD2RUCJoU2PSH7boinA
egABw3d4Ay3WtQIgFLvvlCHYdZ4aA5WmaIreyHXG2J1R0tUuF8tcAfBgt08CIBsS
pR8b4bhxP6rQ2sewzV7cM5PlzwOGFVKrBVXlvPbo
-----END RSA PRIVATE KEY-----

publci key:

-----BEGIN PUBLIC KEY-----
MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAMUVTgdp73c0YeU5fItHsNiNINsF6zJj
ZSCjIvOxBoBrtxzwL2Pe4IMDjX2m+YShHNdikcIVkB9kIQg6u77z4m8CAwEAAQ==
-----END PUBLIC KEY-----

php server user privatekey encrypt:

No.1
HudnLQF7vK0g3IBlI/IHDqK6RqGzBqsfeRbh6moxP+k+I6ZVARIxcnXHHMBxQ1oXY/omdknhRAhHWEdrl/D65g==

No.2
tfcd+/WuXwwP9nvO25T6iAORPYqtD0on/HipLciS+7HDdxXxL3KMHdDlUWxKOpXy5PQg6Pwt/cFopxcLBDSf/A==

delphi publickey decrypt error:

error:0407006A:rsa routines:RSA_padding_check_PKCS1_type_1:block type is not 01
error:04067072:rsa routines:RSA_EAY_PUBLIC_DECRYPT:padding check failed

fix:

            //fill last #10
            if (re_encode_session[Length(re_encode_session)-1] <> #10) then
            begin
               re_encode_session:=re_encode_session+ char(10);
            end;


            //Rsa public decrypt
            bRSAData.CryptedData := re_encode_session;
            fRSAOpenSSL.PublicDecrypt(bRSAData);  

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.