Separating public and private keys from RSA keypair variable

后端 未结 4 2025
陌清茗
陌清茗 2020-12-18 13:04

As the title says, I have some code that generates a pair of RSA keys. I want to split them apart and use them individually to encrypt/decrypt, rather than use the variable

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-18 13:46

    Reviewing your code, it appears that you successfully separated the public and private keys into the strings pub_key and pri_key, but then used printf to output them which pasted them back together. To just print the public key change the printf statement to:

    printf("\n%s\n", pub_key); 
    

提交回复
热议问题