CryptoPP RSA

This is a discussion on CryptoPP RSA within the C++ Programming forums, part of the General Programming Boards category; Hey I want to implement RSA crypt in my server, but I have question, how can I write/load public key? ...

  1. #1
    Registered User
    Join Date
    Mar 2011
    Posts
    69

    CryptoPP RSA

    Hey I want to implement RSA crypt in my server, but I have question, how can I write/load public key?

    Like I want to send public key from server to client and then read those 128 bytes and set as key. Any clues?

  2. #2
    Registered User
    Join Date
    Apr 2008
    Posts
    90
    It depends on the crypto library you're using.

    If you're using OpenSSL, check out BN_bin2bn and BN_bn2bin. If you're using the Windows CryptoAPI, use CryptExportKey and CryptImportKey.

  3. #3
    Registered User
    Join Date
    Mar 2011
    Posts
    69
    Well I found that I can use this method :

    Code:
    publicKey.Save( StringSink(sPublicKey).Ref() );
    But it's encoded public key after save (160B), is there way to save decoded as normal?
    Last edited by kargo; 04-11-2011 at 10:22 AM.

  4. #4
    Registered User
    Join Date
    Apr 2008
    Posts
    90
    That's where the functions I mentioned come into play, although they are plain C functions, so they don't take a class as parameters.

    EDIT: I just realized you're using a third party crypto library, so what I said before unfortunately doesn't help you much, unless you use a different library.
    Last edited by Clairvoyant1332; 04-11-2011 at 12:20 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. RSA encryption
    By waterborne in forum C Programming
    Replies: 1
    Last Post: 12-16-2009, 04:51 PM
  2. RSA Encryption, S.O.S. Emergency Distress Signal
    By sofiastrange in forum C Programming
    Replies: 1
    Last Post: 09-05-2009, 08:52 AM
  3. Replies: 2
    Last Post: 04-03-2008, 10:00 AM
  4. RSA algorithm implementations and corresponding bin sizes
    By rohit99 in forum C++ Programming
    Replies: 1
    Last Post: 04-03-2008, 09:53 AM
  5. RSA Encryption
    By minesweeper in forum Tech Board
    Replies: 6
    Last Post: 08-30-2003, 02:48 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21