{"id":796,"date":"2009-12-03T23:02:14","date_gmt":"2009-12-03T23:02:14","guid":{"rendered":"http:\/\/pchero21.com\/?p=796"},"modified":"2009-12-03T23:02:14","modified_gmt":"2009-12-03T23:02:14","slug":"openlssl-rsa-%ed%8c%a8%ed%82%a4%ec%a7%80%eb%a5%bc-%ec%9d%b4%ec%9a%a9%ed%95%9c-%ec%95%94%ed%98%b8%ed%99%94-%eb%b3%b5%ed%98%b8%ed%99%94","status":"publish","type":"post","link":"http:\/\/pchero21.com\/?p=796","title":{"rendered":"OpenlSSL &#8211; RSA \ud328\ud0a4\uc9c0\ub97c \uc774\uc6a9\ud55c \uc554\ud638\ud654 &#038; \ubcf5\ud638\ud654"},"content":{"rendered":"<p>\/\/ &nbsp; &nbsp;&nbsp; use_rsa.c<br \/>\/\/ &nbsp; &nbsp; &nbsp;<br \/>\/\/ &nbsp; &nbsp;&nbsp; Copyright 2009 Kim Sung-tae &lt;pchero21@gmail.com&gt;<br \/>\/\/ &nbsp; &nbsp; &nbsp;<br \/>\/\/ &nbsp; &nbsp;&nbsp; This program is free software; you can redistribute it and\/or modify<br \/>\/\/ &nbsp; &nbsp;&nbsp; it under the terms of the GNU General Public License as published by<br \/>\/\/ &nbsp; &nbsp;&nbsp; the Free Software Foundation; either version 2 of the License, or<br \/>\/\/ &nbsp; &nbsp;&nbsp; (at your option) any later version.<br \/>\/\/ &nbsp; &nbsp; &nbsp;<br \/>\/\/ &nbsp; &nbsp;&nbsp; This program is distributed in the hope that it will be useful,<br \/>\/\/ &nbsp; &nbsp;&nbsp; but WITHOUT ANY WARRANTY; without even the implied warranty of<br \/>\/\/ &nbsp; &nbsp;&nbsp; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.&nbsp; See the<br \/>\/\/ &nbsp; &nbsp;&nbsp; GNU General Public License for more details.<br \/>\/\/ &nbsp; &nbsp; &nbsp;<br \/>\/\/ &nbsp; &nbsp;&nbsp; You should have received a copy of the GNU General Public License<br \/>\/\/ &nbsp; &nbsp;&nbsp; along with this program; if not, write to the Free Software<br \/>\/\/ &nbsp; &nbsp;&nbsp; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,<br \/>\/\/ &nbsp; &nbsp;&nbsp; MA 02110-1301, USA.<\/p>\n<p>#include &lt;stdio.h&gt;<br \/>#include &lt;string.h&gt;<\/p>\n<p>#include &lt;openssl\/bio.h&gt;<br \/>#include &lt;openssl\/err.h&gt;<br \/>#include &lt;openssl\/bn.h&gt;<br \/>#include &lt;openssl\/rsa.h&gt;<br \/>#include &lt;openssl\/evp.h&gt;<br \/>#include &lt;openssl\/objects.h&gt;<br \/>#include &lt;openssl\/x509.h&gt;<br \/>#include &lt;openssl\/rand.h&gt;<br \/>#include &lt;openssl\/pem.h&gt;<\/p>\n<p>int main(int argc, char** argv)<br \/>{<br \/>&nbsp;&nbsp; &nbsp;\/\/ \ubcc0\uc218 \uc815\uc758<br \/>&nbsp;&nbsp; &nbsp;BIO *keyBIO = NULL;<br \/>&nbsp;&nbsp; &nbsp;BIO *errBIO = NULL;<br \/>&nbsp;&nbsp; &nbsp;BIO *rsa = NULL;<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;char keyFile[100];<br \/>&nbsp;&nbsp; &nbsp;char KeyFormat[10];<br \/>&nbsp;&nbsp; &nbsp;char encType[10];<br \/>&nbsp;&nbsp; &nbsp;char keyType[10];<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;char inFile[100];<br \/>&nbsp;&nbsp; &nbsp;char outFile[100];<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;BIO *inBIO = NULL;<br \/>&nbsp;&nbsp; &nbsp;BIO *outBIO = NULL;<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;\/\/ \ud45c\uc900 \ud654\uba74 \ucd9c\ub825 BIO \uc0dd\uc131<br \/>&nbsp;&nbsp; &nbsp;if((errBIO = BIO_new(BIO_s_file())) != NULL)<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;BIO_set_fp(errBIO, stderr, BIO_NOCLOSE|BIO_FP_TEXT);<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;\/\/ \uc554\ud638\ud654\ub97c \ud55c\uac74\uc9c0 \ubcf5\ud638\ud654\ub97c \ud55c \uac74\uc9c0 \uc120\ud0dd<br \/>&nbsp;&nbsp; &nbsp;printf(&#8220;\uc554\ud638\ud654, \ubcf5\ud638\ud654 \uc120\ud0dd (e,d): &#8220;);<br \/>&nbsp;&nbsp; &nbsp;scanf(&#8220;%s&#8221;, encType);<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;\/\/ \ud0a4\ub97c \uacf5\uac1c\ud0a4\ub97c \uc0ac\uc6a9 \ud560 \uac74\uc9c0, \uac1c\uc778\ud0a4\ub97c \uc0ac\uc6a9 \ud560 \uac74\uc9c0 \uc120\ud0dd<br \/>&nbsp;&nbsp; &nbsp;printf(&#8220;\uacf5\uac1c\ud0a4, \uac1c\uc778\ud0a4 \uc120\ud0dd(pri,pub): &#8220;);<br \/>&nbsp;&nbsp; &nbsp;scanf(&#8220;%s&#8221;, keyType);<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;\/\/ \ud0a4 \ud30c\uc77c\uba85 \uc785\ub825<br \/>&nbsp;&nbsp; &nbsp;printf(&#8220;\ud0a4 \ud30c\uc77c\uc744 \uc785\ub825 \ud558\uc138\uc694: &#8220;);<br \/>&nbsp;&nbsp; &nbsp;scanf(&#8220;%s&#8221;, keyFile);<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;\/\/ \ud0a4 \ud30c\uc77c \ud615\uc2dd \uc785\ub825<br \/>&nbsp;&nbsp; &nbsp;printf(&#8220;\ud0a4 \ud30c\uc77c\uc758 \ud615\uc2dd\uc744 \uc785\ub825 \ud558\uc138\uc694. (PEM,DER): &#8220;);<br \/>&nbsp;&nbsp; &nbsp;scanf(&#8220;%s&#8221;, KeyFormat);<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;\/\/ \uc785\ub825 \ud30c\uc77c\uba85 \uc785\ub825<br \/>&nbsp;&nbsp; &nbsp;printf(&#8220;\uc785\ub825 \ud30c\uc77c\uba85\uc744 \uc785\ub825 \ud558\uc138\uc694: &#8220;);<br \/>&nbsp;&nbsp; &nbsp;scanf(&#8220;%s&#8221;, inFile);<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;\/\/ \ucd9c\ub825 \ud30c\uc77c\uba85 \uc785\ub825<br \/>&nbsp;&nbsp; &nbsp;printf(&#8220;\ucd9c\ub825 \ud30c\uc77c\uba85\uc744 \uc785\ub825 \ud558\uc138\uc694: &#8220;);<br \/>&nbsp;&nbsp; &nbsp;scanf(&#8220;%s&#8221;, outFile);<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;\/\/ \ud0a4 \ud30c\uc77c BIO \uc0dd\uc131<br \/>&nbsp;&nbsp; &nbsp;keyBIO = BIO_new(BIO_s_file());<br \/>&nbsp;&nbsp; &nbsp;if(keyBIO == NULL) {<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ERR_print_errors(errBIO);<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;exit(1);<br \/>&nbsp;&nbsp; &nbsp;}<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;\/\/ \ud0a4 \ud30c\uc77c \uc77d\uc74c<br \/>&nbsp;&nbsp; &nbsp;if(BIO_read_filename(keyBIO, keyFile) &lt;= 0) {<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;BIO_printf(errBIO, &#8220;\ud0a4 \ud30c\uc77c [%s]\uc744 \uc5ec\ub294\ub370 \uc5d0\ub7ec\uac00 \ubc1c\uc0dd \ud588\uc2b5\ub2c8\ub2e4.&#8221;, keyFile);<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ERR_print_errors(errBIO);<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;exit(1);<br \/>&nbsp;&nbsp; &nbsp;}<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;\/\/ DER \ud615\uc2dd\uc774\uba74, \ud0a4 \ud30c\uc77c BIO\uc5d0\uc11c \ud0a4 \ub0b4\uc6a9\uc744 \uc77d\uc5b4\uc11c rsa \uad6c\uc870\uccb4 \ud615\uc2dd\uc73c\ub85c \ubcc0\ud658<br \/>&nbsp;&nbsp; &nbsp;if(strcmp(KeyFormat, &#8220;DER&#8221;) == 0) {<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;\/\/ \uac1c\uc778\ud0a4\uc640 \uacf5\uac1c\ud0a4\uc5d0 \ub530\ub77c\uc11c \ub2e4\ub978 \ud568\uc218 \uc0ac\uc6a9<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if(strcmp(keyType, &#8220;pub&#8221;) == 0)<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rsa = d2i_RSAPublicKey_bio(keyBIO, NULL);<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;else<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rsa = d2i_RSAPrivateKey_bio(keyBIO, NULL);<br \/>&nbsp;&nbsp; &nbsp;}<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;\/\/ PEM \ud615\uc2dd\uc774\uba74, \ud0a4 \ud30c\uc77c BIO\uc5d0\uc11c \ud0a4 \ub0b4\uc6a9\uc744 \uc77d\uc5b4\uc11c rsa \uad6c\uc870\uccb4 \ud615\uc2dd\uc73c\ub85c \ubcc0\ud658<br \/>&nbsp;&nbsp; &nbsp;else if(strcmp(KeyFormat, &#8220;PEM&#8221;) == 0) {<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;\/\/ \uac1c\uc778\ud0a4\uc640 \uacf5\uac1c\ud0a4\uc5d0 \ub530\ub77c\uc11c \ub2e4\ub978 \ud568\uc218 \uc0ac\uc6a9<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if(strcmp(keyType, &#8220;pub&#8221;) == 0)<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rsa = PEM_read_bio_RSA_PUBKEY(keyBIO, NULL, NULL, NULL);<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;else <br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rsa = PEM_read_bio_RSAPrivateKey(keyBIO, NULL, NULL, NULL);<br \/>&nbsp;&nbsp; &nbsp;}<br \/>&nbsp;&nbsp; &nbsp;else {<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;BIO_printf(errBIO, &#8220;\uc54c \uc218 \uc5c6\ub294 \ud3ec\uba67[%s] \uc785\ub2c8\ub2e4.&#8221;, KeyFormat);<br \/>&nbsp;&nbsp; &nbsp;}<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;\/\/ \ud0a4\ub97c \ub85c\ub4dc \ud558\ub294\ub370 \uc5d0\ub7ec \ubc1c\uc0dd<br \/>&nbsp;&nbsp; &nbsp;if(rsa == NULL) {<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;BIO_printf(errBIO, &#8220;\ud0a4\ub97c \ub85c\ub4dc \ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.&#8221;);<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ERR_print_errors(errBIO);<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;exit(1);<br \/>&nbsp;&nbsp; &nbsp;}<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;\/\/ \uc785\ub825 \ud30c\uc77c\uc5d0\uc11c BIO \uc0dd\uc131<br \/>&nbsp;&nbsp; &nbsp;inBIO = BIO_new_file(inFile, &#8220;rb&#8221;);<br \/>&nbsp;&nbsp; &nbsp;if(!inBIO) {<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;BIO_printf(errBIO, &#8220;\uc785\ub825 \ud30c\uc77c [%s]\uc744 \uc5ec\ub294\ub370 \uc5d0\ub7ec\uac00 \ubc1c\uc0dd \ud588\uc2b5\ub2c8\ub2e4.&#8221;, inFile);<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ERR_print_errors(errBIO);<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;exit(1);<br \/>&nbsp;&nbsp; &nbsp;}<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;\/\/ \ucd9c\ub825 \ud30c\uc77c\uc5d0\uc11c BIO \uc0dd\uc131<br \/>&nbsp;&nbsp; &nbsp;outBIO = BIO_new_file(outFile, &#8220;wb&#8221;);<br \/>&nbsp;&nbsp; &nbsp;if(!outBIO) {<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;BIO_printf(errBIO, &#8220;\ucd9c\ub825 \ud30c\uc77c [%s]\uc744 \uc0dd\uc131\ud558\ub294\ub370 \uc5d0\ub7ec\uac00 \ubc1c\uc0dd \ud588\uc2b5\ub2c8\ub2e4.&#8221;, outFile);<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ERR_print_errors(errBIO);<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;exit(1);<br \/>&nbsp;&nbsp; &nbsp;}<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;\/\/ \uc77d\uc740 \ud0a4\uc758 \uae38\uc774\ub97c \uc5bb\uc74c<br \/>&nbsp;&nbsp; &nbsp;int keySize = RSA_size(rsa);<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;\/\/ \uc785\ub825\ubb38 \ub0b4\uc6a9\uc774 \ub4e4\uc5b4\uac08 \ubc84\ud37c\uc640, \ucd9c\ub825\ubb38 \ub0b4\uc6a9\uc774 \ub4e4\uc5b4\uac08 \ubc84\ud37c \uc0dd\uc131<br \/>&nbsp;&nbsp; &nbsp;\/\/ \uc785\ub825 \ubc84\ud37c\uc758 \uae38\uc774\ub294 \ud0a4 \uae38\uc774\uc758 \ub450\ubc30, \ucd9c\ub825 \ubc84\ud37c\ub294 \ud0a4 \uae38\uc774\uc640 \ub3d9\uc77c<br \/>&nbsp;&nbsp; &nbsp;unsigned char *inBuffer = (unsigned char *)malloc(keySize * 2);<br \/>&nbsp;&nbsp; &nbsp;unsigned char *outBuffer = (unsigned char *)malloc(keySize);<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;\/\/ \ud328\ub529 \uc815\uc758, \uc77c\ubc18\uc801\uc778 \ud328\ub529\uc73c\ub85c \uc0ac\uc6a9<br \/>&nbsp;&nbsp; &nbsp;unsigned char pad = RSA_PKCS1_PADDING;<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;\/\/ \uc785\ub825\ubb38 \ud30c\uc77c\uc5d0\uc11c \ub0b4\uc6a9 \uc77d\uc5b4 \ubc84\ud37c\uc5d0 \uc800\uc7a5<br \/>&nbsp;&nbsp; &nbsp;int inLength = BIO_read(inBIO, inBuffer, keySize * 2);<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;int outLength = 0;<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;\/\/ \uacf5\uac1c\ud0a4\ub85c \uc554\ud638\ud654 \ud560\ub54c, \uc785\ub825 \ubc84\ud37c\uc758 \ub0b4\uc6a9\uc744 \uc554\ud638\ud654\ud574\uc11c \ucd9c\ub825 \ubc84\ud37c\uc5d0 \ub123\uc74c<br \/>&nbsp;&nbsp; &nbsp;if((strcmp(encType, &#8220;e&#8221;) == 0) &amp;&amp; (strcmp(keyType, &#8220;pub&#8221;) == 0))<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;outLength = RSA_public_encrypt(inLength, inBuffer, outBuffer, rsa, pad);<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;\/\/ \uac1c\uc778\ud0a4\ub85c \uc554\ud638\ud654 \ud560\ub54c, \uc785\ub825 \ubc84\ud37c\uc758 \ub0b4\uc6a9\uc744 \uc554\ud638\ud654\ud574\uc11c \ucd9c\ub825 \ubc84\ud37c\uc5d0 \ub123\uc74c<br \/>&nbsp;&nbsp; &nbsp;else if((strcmp(encType, &#8220;e&#8221;) == 0) &amp;&amp; (strcmp(keyType, &#8220;pri&#8221;) == 0))<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;outLength = RSA_private_encrypt(inLength, inBuffer, outBuffer, rsa, pad);<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;\/\/ \uacf5\uce90\ud0a4\ub85c \ubcf5\ud638\ud654 \ud560\ub54c, \uc785\ub825 \ubc84\ud37c\uc758 \ub0b4\uc6a9\uc744 \ubcf5\ud638\ud654\ud574\uc11c \ucd9c\ub825 \ubc84\ud37c\uc5d0 \ub123\uc74c<br \/>&nbsp;&nbsp; &nbsp;else if((strcmp(encType, &#8220;d&#8221;) == 0) &amp;&amp; (strcmp(keyType, &#8220;pub&#8221;) == 0))<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;outLength = RSA_public_decrypt(inLength, inBuffer, outBuffer, rsa, pad);<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;else if((strcmp(encType, &#8220;d&#8221;) == 0) &amp;&amp; (strcmp(keyType, &#8220;pri&#8221;) == 0))<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;outLength = RSA_private_decrypt(inLength, inBuffer, outBuffer, rsa, pad);<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;\/\/ \uc554\ud638\ud654 \ud639\uc740 \ubcf5\ud638\ud654\uc2dc \uc5d0\ub7ec \ubc1c\uc0dd \uccb4\ud06c<br \/>&nbsp;&nbsp; &nbsp;if(outLength &lt;= 0) {<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;BIO_printf(errBIO, &#8220;RSA \uc554\ud638\ud654\uc2dc \uc5d0\ub7ec \ubc1c\uc0dd&#8221;);<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ERR_print_errors(errBIO);<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;exit(1);<br \/>&nbsp;&nbsp; &nbsp;}<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;\/\/ \ucd9c\ub825 \ud30c\uc77c\uc5d0 \ucd9c\ub825 \ubc84\ud37c\uc758 \ub0b4\uc6a9 \uc800\uc7a5<br \/>&nbsp;&nbsp; &nbsp;BIO_write(outBIO, outBuffer, outLength);<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;BIO_printf(errBIO, &#8220;\uc644\ub8cc \ub418\uc5c8\uc2b5\ub2c8\ub2e4.&#8221;);<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;\/\/ \uac1d\uccb4 \uc81c\uac70<br \/>&nbsp;&nbsp; &nbsp;if(keyBIO != NULL)<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;BIO_free(keyBIO);<br \/>&nbsp;&nbsp; &nbsp;if(rsa != NULL)<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;RSA_free(rsa);<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;free(inBuffer);<br \/>&nbsp;&nbsp; &nbsp;free(outBuffer);<br \/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;<br \/>&nbsp;&nbsp; &nbsp;return 0;<br \/>}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/\/ &nbsp; &nbsp;&nbsp; use_rsa.c\/\/ &nbsp; &nbsp; &nbsp;\/\/ &nbsp; &nbsp;&nbsp; Copyright 2009 Kim Sung-tae &lt;pchero21@gmail.com&gt;\/\/ &nbsp; &nbsp; &nbsp;\/\/ &nbsp; &nbsp;&nbsp; This program is free software; you can redistribute it and\/or modify\/\/ &nbsp; &nbsp;&nbsp; it under the terms of the GNU General &hellip; <a href=\"http:\/\/pchero21.com\/?p=796\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[53],"tags":[297,364],"_links":{"self":[{"href":"http:\/\/pchero21.com\/index.php?rest_route=\/wp\/v2\/posts\/796"}],"collection":[{"href":"http:\/\/pchero21.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/pchero21.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/pchero21.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/pchero21.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=796"}],"version-history":[{"count":0,"href":"http:\/\/pchero21.com\/index.php?rest_route=\/wp\/v2\/posts\/796\/revisions"}],"wp:attachment":[{"href":"http:\/\/pchero21.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=796"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/pchero21.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=796"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/pchero21.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=796"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}