How do I generate safe and strong keys suitable for use with Lockbox for commercial requirements and product deployment in which sensitive information must be protected?
ADI does not directly provide key management services. One recommended approach would be to partner with a 3rd party that has security expertise and experience.
For example, Elliptic http://www.ellipticsemi.com/ is a 3rd party member of the ADI DSP Collaborative that is familiar with the Blackfin processor. They have utilities for key generation and for signing messages.
Another approach may be to download one of the many cryptography libraries available online. Miracl http://www.shamus.ie/ is one such set of libraries. If you use a library, you should make sure that you pick the Koblitz curve and the parameters described in the Blackfin literature (BF54x hardware reference manual and also in the VisualDSP++ Lockbox example).
Often times, these libraries provide usage examples that demonstrate the usage of the library but that should not be used as is. For example, the signature generation and the message signing operations require random number generation. The libraries will often use a pseudo random number generation or will simply use a constant number instead. If you want to use such libraries, you need to make sure that you are using a true random number for the signature generation and for the message signing.
The utility provided to demonstrate security features with the ADI EZ-Kit, ecsgen, is distributed solely for demonstration use and relies on a non-cryptographically robust 9 digit decimal input to seed its internal random number generator. The internal random number generator is NOT truly random. The internal random number generator is actually implemented as a Marsaglia & Zaman pseudo-random number generator (PRNG). Since there is a 1:1 relationship between the seed and the resulting "random" number, this exposes the private/public key to a brute-force attack by simply generating private/public keys for all 1 billion possible seed values and checking the resulting public keys until you find a match. This exposes the private key!
1) DO NOT USE ecsgen to generate a private key for Blackfin Lockbox unless you replace the PRNG - see item 2).
2) Ideally, I would advise you to use a true Hardware Random Number generator (HRNG) to create the private key. This means that you should NEVER be able to generate the same private key twice.
3) You should verify that the random number you chose for the private key is not possible to obtain from ecsgen2 or from whatever method you choose to use for your key generation.
Use a seed from a true HRNG or a seed of your choosing with acceptable entropy suitable for your application.
The information on this page be understood before use of any of these numbers:
The following are some of the sources of true random numbers:
Whatever the source of the data - It is critical to independently confirm that the data is truly random.
See http://www.random.org/statistics/ for some of these tests that should be duplicated on the data regardless of its source.
Finally - It is important to avoid random numbers that are easily generated or guessed:
ie: lowest, middle and highest 1 Trillion numbers, binary, hex or decimal boundaries, over-represented, repeating or sequential sequenced digits, numbers that represent real items (telephone numbers, birthdays etc.)
This FAQ was generated from the following discussion: Lockbox