Click here to Skip to main content
15,905,504 members
Home / Discussions / C#
   

C#

 
AnswerRe: A problem with WebBrowser control Pin
led mike25-Jun-06 8:42
led mike25-Jun-06 8:42 
QuestionDirectSound Pin
surfman1924-Jun-06 13:36
surfman1924-Jun-06 13:36 
QuestionHow do I encrypt (hide) an encryption-key variable without its value being shown in the ildasm (assembly) in C#/.NET Pin
yoffir24-Jun-06 13:17
yoffir24-Jun-06 13:17 
AnswerRe: How do I encrypt (hide) an encryption-key variable without its value being shown in the ildasm (assembly) in C#/.NET Pin
Colin Angus Mackay24-Jun-06 14:42
Colin Angus Mackay24-Jun-06 14:42 
AnswerRe: How do I encrypt (hide) an encryption-key variable without its value being shown in the ildasm (assembly) in C#/.NET Pin
Paul Conrad24-Jun-06 19:08
professionalPaul Conrad24-Jun-06 19:08 
GeneralRe: How do I encrypt (hide) an encryption-key variable without its value being shown in the ildasm (assembly) in C#/.NET Pin
Colin Angus Mackay24-Jun-06 23:54
Colin Angus Mackay24-Jun-06 23:54 
GeneralRe: How do I encrypt (hide) an encryption-key variable without its value being shown in the ildasm (assembly) in C#/.NET Pin
Paul Conrad25-Jun-06 7:23
professionalPaul Conrad25-Jun-06 7:23 
AnswerRe: How do I encrypt (hide) an encryption-key variable without its value being shown in the ildasm (assembly) in C#/.NET Pin
mav.northwind25-Jun-06 0:17
mav.northwind25-Jun-06 0:17 
Hi!

You'll always have a problem keeping secrets secret, but there indeed is something you can do.
If you need a symmetric encryption (like in your case), then placing the key inside an assembly is not a good ides, you're right.

One solution that comes to mind is to create the key at runtime.
At any point in your application's life cycle, you'll have the connection string unencrypted. Then you could create a random key and store this key in a safe place (a protected registry key or an isolated storage). Now encrypt the string with the random key and write it to your config file.
For decrypting you can get the key from the registry or IS and you'll be fine.

That way you don't have to hardcode any secret inside your assemblies. But you have to be careful nevertheless that the method creating and storing the random key isn't being executed by an untrusted caller, or else this caller could easily manipulate the connection string (although it's not so easy to find out the secret key, but he doesn't have to - your method does all the "dirty work" for him).

Regards,
mav

--
Black holes are the places where god divided by 0...
QuestionHow to invoke windows API in C# Pin
ZHENG.YANG.POINTER24-Jun-06 12:11
professionalZHENG.YANG.POINTER24-Jun-06 12:11 
AnswerRe: How to invoke windows API in C# Pin
Christian Graus24-Jun-06 12:15
protectorChristian Graus24-Jun-06 12:15 
QuestionSpeech Compression for Voice Chat Pin
surfman1924-Jun-06 11:41
surfman1924-Jun-06 11:41 
AnswerRe: Speech Compression for Voice Chat Pin
Ed.Poore24-Jun-06 12:47
Ed.Poore24-Jun-06 12:47 
GeneralRe: Speech Compression for Voice Chat Pin
surfman1924-Jun-06 13:33
surfman1924-Jun-06 13:33 
GeneralRe: Speech Compression for Voice Chat Pin
Ed.Poore25-Jun-06 9:03
Ed.Poore25-Jun-06 9:03 
AnswerRe: Speech Compression for Voice Chat Pin
mav.northwind25-Jun-06 0:20
mav.northwind25-Jun-06 0:20 
Questionobject vs. text stream Pin
Ed 5424-Jun-06 10:40
Ed 5424-Jun-06 10:40 
AnswerRe: object vs. text stream Pin
Ed 5424-Jun-06 11:19
Ed 5424-Jun-06 11:19 
QuestionSMS Server Pin
mostafa_h24-Jun-06 10:36
mostafa_h24-Jun-06 10:36 
QuestionHow do you implement a message queuing system? Pin
Steve Messer24-Jun-06 10:25
Steve Messer24-Jun-06 10:25 
AnswerRe: How do you implement a message queuing system? Pin
Ed.Poore24-Jun-06 12:56
Ed.Poore24-Jun-06 12:56 
GeneralRe: How do you implement a message queuing system? Pin
Steve Messer24-Jun-06 15:00
Steve Messer24-Jun-06 15:00 
GeneralRe: How do you implement a message queuing system? Pin
Leslie Sanford24-Jun-06 19:55
Leslie Sanford24-Jun-06 19:55 
GeneralRe: How do you implement a message queuing system? [modified] Pin
Steve Messer24-Jun-06 20:15
Steve Messer24-Jun-06 20:15 
GeneralRe: How do you implement a message queuing system? Pin
Leslie Sanford24-Jun-06 21:11
Leslie Sanford24-Jun-06 21:11 
GeneralRe: How do you implement a message queuing system? Pin
Steve Messer25-Jun-06 3:47
Steve Messer25-Jun-06 3:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.