Click here to Skip to main content
15,895,084 members
Home / Discussions / C#
   

C#

 
AnswerRe: adding a .cs file programatically in C#.net Pin
sathish s31-May-06 1:35
sathish s31-May-06 1:35 
QuestionRetrieving correct indexed icon from iconfiles / exefiles Pin
Larantz30-May-06 23:17
Larantz30-May-06 23:17 
AnswerRe: Retrieving correct indexed icon from iconfiles / exefiles [modified] Pin
Larantz31-May-06 0:54
Larantz31-May-06 0:54 
Questionadd controls to TabPage Pin
rcwoods30-May-06 23:06
rcwoods30-May-06 23:06 
AnswerRe: add controls to TabPage Pin
rah_sin30-May-06 23:20
professionalrah_sin30-May-06 23:20 
AnswerRe: add controls to TabPage Pin
Mairaaj Khan31-May-06 0:04
professionalMairaaj Khan31-May-06 0:04 
QuestionService starts and stops immediately Pin
israfel30-May-06 23:06
israfel30-May-06 23:06 
QuestionHow to Hide A Process in TaskManager ?? Pin
hdv21230-May-06 23:02
hdv21230-May-06 23:02 
AnswerRe: How to Hide A Process in TaskManager ?? Pin
Guffa31-May-06 0:14
Guffa31-May-06 0:14 
QuestionNorminv Function in C# Pin
Joachim Maes30-May-06 22:53
Joachim Maes30-May-06 22:53 
AnswerRe: Norminv Function in C# Pin
FarhanShariff16-Apr-14 23:13
professionalFarhanShariff16-Apr-14 23:13 
QuestionHow to know the parent of Form class Pin
Maddie from Dartford30-May-06 21:55
Maddie from Dartford30-May-06 21:55 
AnswerRe: How to know the parent of Form class Pin
stancrm30-May-06 22:22
stancrm30-May-06 22:22 
AnswerRe: How to know the parent of Form class Pin
subburaj.sabapathy31-May-06 2:38
subburaj.sabapathy31-May-06 2:38 
QuestionInvalid Character in XmlDocument Pin
malikjhangirahmed@hotmail.com30-May-06 21:10
malikjhangirahmed@hotmail.com30-May-06 21:10 
AnswerRe: Invalid Character in XmlDocument Pin
NaNg1524131-May-06 1:09
NaNg1524131-May-06 1:09 
QuestionListbox Item Selection Pin
Brendan Vogt30-May-06 21:01
Brendan Vogt30-May-06 21:01 
AnswerRe: Listbox Item Selection Pin
malikjhangirahmed@hotmail.com30-May-06 21:19
malikjhangirahmed@hotmail.com30-May-06 21:19 
QuestionRe: Listbox Item Selection Pin
Brendan Vogt30-May-06 21:28
Brendan Vogt30-May-06 21:28 
AnswerRe: Listbox Item Selection [modified] Pin
albCode30-May-06 22:06
albCode30-May-06 22:06 
QuestionRe: Listbox Item Selection [modified] Pin
Brendan Vogt30-May-06 22:25
Brendan Vogt30-May-06 22:25 
QuestionDatagridview - programmatic Cell updation Question Pin
Tushar Bhatt30-May-06 20:58
Tushar Bhatt30-May-06 20:58 
AnswerRe: Datagridview - programmatic Cell updation Question Pin
Mairaaj Khan30-May-06 23:26
professionalMairaaj Khan30-May-06 23:26 
GeneralRe: Datagridview - programmatic Cell updation Question Pin
Tushar Bhatt1-Jun-06 19:09
Tushar Bhatt1-Jun-06 19:09 
QuestionEncryption Decryption Problem in Web Services Pin
malikjhangirahmed@hotmail.com30-May-06 20:50
malikjhangirahmed@hotmail.com30-May-06 20:50 
Hi,
I am using the following code to decrypt an array of bytes:
DESCryptoServiceProvider des=new DESCryptoServiceProvider();
des.BlockSize=blockSize;
des.Key=kDESKey;
des.KeySize=64;

des.Padding=PaddingMode.PKCS7;
des.Mode=CipherMode.ECB;

ICryptoTransform cryptoTransform=des.CreateDecryptor();
MemoryStream mem=new MemoryStream(cipherTextBytes);
CryptoStream cryptoStream=new CryptoStream(mem,cryptoTransform,CryptoStreamMode.Read);

byte[] outputBuffer=new byte[cipherTextBytes.Length];
cryptoStream.Read(outputBuffer,0,outputBuffer.Length);

mem.Close();
cryptoStream.Close();
return outputBuffer;

But the problem is that when i call Read of the cryptoStream, i get System.Cryptography.CryptographicException with the message of "Bad Data". Basically above code is the part of a web service. I am not concerned with the above code. I just want to provide some security feature to my web service. If it can be done through some other easy way, that's also welcome.
Please guide me in this regard...

Wasif Ehsan.

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.