|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Cryptography: RSA Questions1) Is RSA used by other programming system? Eg. If I gen. a key,
can I share it and someone with Java, etc. access it? 2). When generating a public key, you get <Modulus> and <Exponent> values. What parts do you need to share with someone. Also, what is the correct format for these values? 3) If someone gives me their public key, how do I format it for XML? Eg. do I need to convert the key in any way or just add a new XML file and put in the key values? Thanks On Fri, 30 Jun 2006 20:04:18 -0500, David wrote:
> 1) Is RSA used by other programming system? Eg. If I gen. a key, Yes. RSA is a standard and implementations of the RSA algorithm exist for> can I share it and someone with Java, etc. access it? many different languages and patforms including Java. (whenever you acess an https:// web page, it is the RSA alorithm that is used to encrypt your data) > 2). When generating a public key, you get <Modulus> and <Exponent> Both (be carefull, you only need to send the public exponent. The private> values. What parts do you need to share with someone. exponent is for you to keep secret and will allow you to decrypt the data encrypted with your public key) > Also, what is Encryption keys are just byte arrays. So there is no format per se. Just> the correct format for these values? send the byte arrays. One thing that might cause problems is that some implementations use little endian while others use big endian for their encryption keys byte arrays. For example, Windows' Crypto API uses little endian while .NET's implementation uses big endian (or the opposite, i forgot). So if for example you generate a key using .NET and send it to a program that uses Crypto API to use this key, you will first need to reverse the byte array before being able to use it. Apart from that, it should work just fine. > 3) If someone gives me their public key, how do I format it for I'm not sure what you mean here. Keys are just byte arrays as i said. I you> XML? Eg. do I need to convert the key in any way or just add a new > XML file and put in the key values? want to store it in a binary file, just write the byte array to the file. If you want to store it to an XML file, you'll first need to convert your key into displayable caracters. To do that, use the Base64 encoding. Then write the resulting string in your XML file. When you'll need to use the key, extract the string from the XML file and use Base64 to retrieve the key's byte array. Note that .NET's crypto classes have fonctions that allows you to store your key in XML format and retrieve your key from XML. I've never used them but i suppose that these fonction do what i've just described. |
|||||||||||||||||||||||