{"action":"created","issue":{"url":"https://api.github.com/repos/openssl/openssl/issues/6678","repository_url":"https://api.github.com/repos/openssl/openssl","labels_url":"https://api.github.com/repos/openssl/openssl/issues/6678/labels{/name}","comments_url":"https://api.github.com/repos/openssl/openssl/issues/6678/comments","events_url":"https://api.github.com/repos/openssl/openssl/issues/6678/events","html_url":"https://github.com/openssl/openssl/issues/6678","id":339406356,"node_id":"MDU6SXNzdWUzMzk0MDYzNTY=","number":6678,"title":"why just encrypted message can be decrypt that only 256 byte?","user":{"login":"ardashir66","id":31339487,"node_id":"MDQ6VXNlcjMxMzM5NDg3","avatar_url":"https://avatars3.githubusercontent.com/u/31339487?v=4","gravatar_id":"","url":"https://api.github.com/users/ardashir66","html_url":"https://github.com/ardashir66","followers_url":"https://api.github.com/users/ardashir66/followers","following_url":"https://api.github.com/users/ardashir66/following{/other_user}","gists_url":"https://api.github.com/users/ardashir66/gists{/gist_id}","starred_url":"https://api.github.com/users/ardashir66/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ardashir66/subscriptions","organizations_url":"https://api.github.com/users/ardashir66/orgs","repos_url":"https://api.github.com/users/ardashir66/repos","events_url":"https://api.github.com/users/ardashir66/events{/privacy}","received_events_url":"https://api.github.com/users/ardashir66/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-09T11:12:59Z","updated_at":"2018-07-09T11:44:53Z","closed_at":null,"author_association":"NONE","body":"hi.\r\nplease help me , i using c++ and openssl, \r\ni encrypted message with private key and when i want to decryption it with public key\r\njust the message decrypted truly that are 256 byte. if 257 or 258 byte  it failed and not decrypted .\r\n\r\n`//---------------------------------- private encrypt\r\n    encrypt = (char*)malloc(RSA_size(private_key));\r\n    int encrypt_length = private_encrypt(strlen(message), (unsigned char*)message, (unsigned char*)encrypt, private_key, RSA_PKCS1_PADDING);\r\n//-------------- func\r\nint private_encrypt(int flen, unsigned char* from, unsigned char* to, RSA* key, int padding) {\r\n    int result = RSA_private_encrypt(flen, from, to, key, padding);\r\n    return result;\r\n}\r\n//---------------- decode pub key\r\n        unsigned char* b64out=(unsigned char*)malloc(length) ;\r\n       int rsa_outlen  = public_decrypt(\r\n            contents1.length(), ( unsigned char*)contents1.c_str(), b64out,\r\n            rsa, RSA_PKCS1_PADDING);\r\n//--------------- func\r\nint public_decrypt(int flen, unsigned char* from, unsigned char* to, RSA* key, int padding) {\r\n\r\n    int result = RSA_public_decrypt(flen, from, to, key, padding);\r\n    return result;\r\n}\r\n\r\n `"},"comment":{"url":"https://api.github.com/repos/openssl/openssl/issues/comments/403451435","html_url":"https://github.com/openssl/openssl/issues/6678#issuecomment-403451435","issue_url":"https://api.github.com/repos/openssl/openssl/issues/6678","id":403451435,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMzQ1MTQzNQ==","user":{"login":"ardashir66","id":31339487,"node_id":"MDQ6VXNlcjMxMzM5NDg3","avatar_url":"https://avatars3.githubusercontent.com/u/31339487?v=4","gravatar_id":"","url":"https://api.github.com/users/ardashir66","html_url":"https://github.com/ardashir66","followers_url":"https://api.github.com/users/ardashir66/followers","following_url":"https://api.github.com/users/ardashir66/following{/other_user}","gists_url":"https://api.github.com/users/ardashir66/gists{/gist_id}","starred_url":"https://api.github.com/users/ardashir66/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ardashir66/subscriptions","organizations_url":"https://api.github.com/users/ardashir66/orgs","repos_url":"https://api.github.com/users/ardashir66/repos","events_url":"https://api.github.com/users/ardashir66/events{/privacy}","received_events_url":"https://api.github.com/users/ardashir66/received_events","type":"User","site_admin":false},"created_at":"2018-07-09T11:44:53Z","updated_at":"2018-07-09T11:44:53Z","author_association":"NONE","body":"thanks in advance for answered fast.\r\nmy plain text is under 100 byte and key 2048 bits.\r\ni dont know why another Padding type not work! so i have chosen  RSA_PKCS1_PADDING.\r\nmy problem is another thing. when encrypted text equal to 256 byte, its worked correctly .\r\nbut some of plain text 257 or 257 byte and not decrypted."}}
{"actor":{"display_login":"ardashir66"}}