473,387 Members | 1,650 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Open and Decrypt Secret Key

I'm trying to write a program in C# using .Nets crypto library. I have my
private key and know my password, but how do I load it into my program to use
for encryption and decryption? Everything I had found so far, has had the
user generate one through .Net, but I have to be able to load my own.

Thank you,
Susan
Apr 4 '06 #1
5 3780
I have done something like this to enc' strings and our xml files.. Can you
be a little more specific Susan of what you are trying to do?.. maybe like a
pseudo code.. I can try to help

VJ

"Susan" <Su***@discussions.microsoft.com> wrote in message
news:65**********************************@microsof t.com...
I'm trying to write a program in C# using .Nets crypto library. I have my
private key and know my password, but how do I load it into my program to
use
for encryption and decryption? Everything I had found so far, has had the
user generate one through .Net, but I have to be able to load my own.

Thank you,
Susan

Apr 5 '06 #2
string symmetricKeyString = @"base64encodedString";

byte[] symmetricKey = Convert.FromBase64String(symmetricKeyString);

SymmetricAlgorithm symmetricAlgorithm = new RijndaelManaged(); <- or
whatever

symmetricAlgorithm.Key = symmetricKey;

etc...

HTH

"Susan" <Su***@discussions.microsoft.com> wrote in message
news:65**********************************@microsof t.com...
I'm trying to write a program in C# using .Nets crypto library. I have my
private key and know my password, but how do I load it into my program to
use
for encryption and decryption? Everything I had found so far, has had the
user generate one through .Net, but I have to be able to load my own.

Thank you,
Susan

Apr 6 '06 #3
How do you decode the secret key (session key in this case) with your private
key?
For instance User1 and User2 are in a conversation and each comes up with
half of the secret key. I need to use the private key to decrypt the secret
key in order to set the AES/Rijndeal key for encrypting and decrypting the
message. I know to Base64Decode the private key, but how do I decrypt it to
find out the secret key for the message passing?

Sorry for such silly questions. I'm really new to this stuff and trying to
learn. :)

Thank you,
Apr 7 '06 #4
Have you downloaded the .Net SDK? It has documentation that has examples on
secret key encryption.

"Susan" wrote:
How do you decode the secret key (session key in this case) with your private
key?
For instance User1 and User2 are in a conversation and each comes up with
half of the secret key. I need to use the private key to decrypt the secret
key in order to set the AES/Rijndeal key for encrypting and decrypting the
message. I know to Base64Decode the private key, but how do I decrypt it to
find out the secret key for the message passing?

Sorry for such silly questions. I'm really new to this stuff and trying to
learn. :)

Thank you,

Apr 27 '06 #5
Hi Susan. What are you doing exactly? I have some samples, but need to
know more about what you are trying to do on both sides to help better.

--
William Stacey [MVP]

"Susan" <Su***@discussions.microsoft.com> wrote in message
news:A3**********************************@microsof t.com...
| How do you decode the secret key (session key in this case) with your
private
| key?
| For instance User1 and User2 are in a conversation and each comes up with
| half of the secret key. I need to use the private key to decrypt the
secret
| key in order to set the AES/Rijndeal key for encrypting and decrypting the
| message. I know to Base64Decode the private key, but how do I decrypt it
to
| find out the secret key for the message passing?
|
| Sorry for such silly questions. I'm really new to this stuff and trying to
| learn. :)
|
| Thank you,
Apr 28 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Benoît | last post by:
Hi, I have generated two keys : "C:>openssl req -nodes -new -x509 -keyout ben.key -out ben.crt -days 3650" I try to encrypt/decrypt a string like "JOHN" with these asymetrics keys. With the...
4
by: Hrvoje Voda | last post by:
Does anyone knows a good example of how to encrypt/decrypt a string? Hrcko
8
by: Gidi | last post by:
Hi, Is there Buid-In fuction in C# that Encrypt and Decrypt strings? i have a textbox which i'm writing into file, and i want to encrypt it before writing, i'm not looking for something fancy,...
7
by: Dica | last post by:
i've used the sample code from msdn to create an encyption/decryption assembly as found here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT10.asp i'm...
9
by: sweety | last post by:
Dear All, How to encrypt a C data file and make binary file and then have to read a bin file at run time and decrypt the file and have to read the data. Any help to achive this pls. Would be...
0
by: Hannibal111111 | last post by:
I found this code on a site for doing string encryption/decryption. The string will encrypt fine, but I get this error when I try to decrypt. Any idea why? I posted the code below. The error...
2
by: Bernard Dhooghe | last post by:
The information center writes: "Encryption Algorithm: The internal encryption algorithm used is RC2 block cipher with padding, the 128-bit secret key is derived from the password using a MD2...
1
by: MimiMi | last post by:
I'm trying to decrypt a byte array in java that was encrypted in C#. I don't get any error messages, just a result that's completely not what I was hoping for. I think I am using the same type of...
2
by: MimiMi | last post by:
I'm trying to decrypt a byte array in java that was encrypted in C#. I don't get any error messages, just a result that's completely not what I was hoping for. I think I am using the same type of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.