hi
how can i digitally sign a file , and verify in my code that the file is not tampered ?
thanks, Ramana kumar. - Edited byRamanakumar Monday, September 21, 2009 4:36 AM
-
| | Ramanakumar | The System.Security.Cryptography.Xml.SignedXml class provides signing and signature verification functionality for XML documents. See http://msdn.microsoft.com/en-us/library/ms229745.aspxfor signing and http://msdn.microsoft.com/en-us/library/ms229950.aspxfor verification. - Marked As Answer byeryangMSFT, ModeratorThursday, September 24, 2009 1:52 AM
-
| | Nicole Calinoiu | By the way, you may glad to see related demo in CodeFx,the demo is located in " Security" solution's " CSDigitalSignature" project. Thanks, Eric
Please remember to mark helpful replies as answers and unmark them if they provide no help. - Marked As Answer byeryangMSFT, ModeratorThursday, September 24, 2009 1:52 AM
-
| | eryang | Good luck with it. Maybe you ought to ask a question next time.
Hans Passant. | | nobugz | Hi Kumar, You didn't ask a question, what issue you encountered in your application?
Thanks, Eric Please remember to mark helpful replies as answers and unmark them if they provide no help. | | eryang | Hi, There are many ways to prevent your file from being tampered, for example, we can generate a MD5 value for the original file, when your partner get the file, they re-generate MD5 value and compare it with the original one to see whether the file is modified. You can find Related Topics at the right of this page, there are some posts about how to digitally sign a MSI file, sign a .vsi package file, or text file. So, we'd better make following things clear beforego further: What's the file used for? for storing configuration or other data? Isita XML file?text file?or other format? Will your application modify the file at runtime?
Thanks, Eric Please remember to mark helpful replies as answers and unmark them if they provide no help. | | eryang | Hi Eric,
it is an xml file,application will use this xml as schema andit won't modifythe file at runtime.
thanks, Ramana kumar. | | Ramanakumar | Hi, The question is, if the file is not desired to be modified, why nottousesome static variables/types (for example, a sigleton instance which contains all schema information)instead of an external file (which is tend to be modified by others)?
Thanks, Eric Please remember to mark helpful replies as answers and unmark them if they provide no help. | | eryang | this file is configurable depending on the client.
so iam not interested having aclass for each client.
thanks, Ramana kumar. | | Ramanakumar | Since the file is located on client machine, we cannot prevent other from reading/writing it. Even though hide it or encrypt it, people canalso access tothe file using some hack tools. If the file is a configuration file for your application,just put it there and trustend users, or encrypt the file. following is some links about how to encrypt file: http://www.codeproject.com/KB/security/fileencryptdecrypt.aspx; http://www.codeproject.com/KB/security/DotNetCrypto.aspx; http://support.microsoft.com/kb/307010; Thanks, Eric
Please remember to mark helpful replies as answers and unmark them if they provide no help. | | eryang | Encryption is a good option.
But i am interested indigital signing as it will perfrorm better compared to encryption-decryption.
thanks, Ramana kumar.
| | Ramanakumar | The System.Security.Cryptography.Xml.SignedXml class provides signing and signature verification functionality for XML documents. See http://msdn.microsoft.com/en-us/library/ms229745.aspxfor signing and http://msdn.microsoft.com/en-us/library/ms229950.aspxfor verification. - Marked As Answer byeryangMSFT, ModeratorThursday, September 24, 2009 1:52 AM
-
| | Nicole Calinoiu | By the way, you may glad to see related demo in CodeFx,the demo is located in " Security" solution's " CSDigitalSignature" project. Thanks, Eric
Please remember to mark helpful replies as answers and unmark them if they provide no help. - Marked As Answer byeryangMSFT, ModeratorThursday, September 24, 2009 1:52 AM
-
| | eryang |
|