OpenSSL question

Posted on 2005-04-20
Last Modified: 2012-06-27
Question about OpenSSL when accepting a connection.

 Can I create keys at run time ?
 Currently i use SSL_CTX_use_certificate_file with a fixed PEM file containing the key.
 How can I generate random key pairs to be used ?
 I tried

RSA* rsa = RSA_generate_key(2048,17,0,0);
but SSL_CTX_use_RSAPrivateKey() fails.


Question by:WxW
    1 Comment
    LVL 22

    Accepted Solution

    You might be trying to do the wrong thing...

    I believe that ssh clients and servers use their respective private key information with the others' public key information, along with random data and time-based data, to negotiate & generate a unique symmetric session key with which they encrypt the 'meat' of the data exchanged between them.   So, all data seen by a malicious observer will be encrypted with a different session key every connection, and (maybe, I'm not sure) perhaps periodically a new session key for a long-term connection.


    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Suggested Solutions

    Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
    This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
    The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
    The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now