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

C#

 
GeneralRe: I cannot find a proper way to do this can someone help Pin
Wes Aday15-Jun-10 12:50
professionalWes Aday15-Jun-10 12:50 
GeneralRe: I cannot find a proper way to do this can someone help Pin
Luc Pattyn15-Jun-10 13:05
sitebuilderLuc Pattyn15-Jun-10 13:05 
GeneralRe: I cannot find a proper way to do this can someone help Pin
Wes Aday15-Jun-10 13:53
professionalWes Aday15-Jun-10 13:53 
GeneralRe: I cannot find a proper way to do this can someone help Pin
safame2015-Jun-10 11:38
professionalsafame2015-Jun-10 11:38 
GeneralRe: I cannot find a proper way to do this can someone help Pin
Luc Pattyn15-Jun-10 11:43
sitebuilderLuc Pattyn15-Jun-10 11:43 
GeneralRe: I cannot find a proper way to do this can someone help Pin
safame2015-Jun-10 11:46
professionalsafame2015-Jun-10 11:46 
GeneralRe: I cannot find a proper way to do this can someone help Pin
Wes Aday15-Jun-10 12:52
professionalWes Aday15-Jun-10 12:52 
Questiondecrypting data Pin
dia 201015-Jun-10 9:10
dia 201015-Jun-10 9:10 
Hi i am new in C#. i am developing a banking system in which each bank sends encrypted messages to each other. i am using 3-DES algorithm.
i am facing following problem.
user sends encrypted message to bank A and bank A decryptes it.here this algorithm works fine but when bank A sends this to Bank B then i am getting this runtime error

"Invalid character in a Base-64 string."

i am using the following code.

string cipherText = richTextBox2.Text.Trim();
            string mykey;                       
            byte[] keyArray;
            byte[] toDecryptArray = Convert.FromBase64String(cipherText);

            StreamReader objReader = new StreamReader("c:\\encryptkey.txt");
            mykey = objReader.ReadToEnd();
            objReader.Close();
            if (mykey.Length < 24) mykey = mykey.PadRight(24, '.');
            keyArray = UTF8Encoding.UTF8.GetBytes(mykey);

            tdes.Key = keyArray;
            tdes.Mode = CipherMode.ECB;
            tdes.Padding = PaddingMode.PKCS7;
            ICryptoTransform myTransform = tdes.CreateDecryptor();
            byte[] resultArray = myTransform.TransformFinalBlock(toDecryptArray, 0, toDecryptArray.Length);

            tdes.Clear();
          
            data = UTF8Encoding.UTF8.GetString(resultArray);



the same code works very fine for first time decryption but not for 2nd time. i am getting error in
byte[] toDecryptArray = Convert.FromBase64String(cipherText);

plz help me.
thanx
AnswerRe: decrypting data Pin
Dr.Walt Fair, PE15-Jun-10 9:47
professionalDr.Walt Fair, PE15-Jun-10 9:47 
QuestionGeneric List in UserControl Pin
Ian Grech15-Jun-10 9:02
Ian Grech15-Jun-10 9:02 
AnswerRe: Generic List in UserControl Pin
Henry Minute15-Jun-10 11:36
Henry Minute15-Jun-10 11:36 
GeneralRe: Generic List in UserControl Pin
Ian Grech15-Jun-10 19:25
Ian Grech15-Jun-10 19:25 
QuestionMessage Removed Pin
15-Jun-10 8:22
professionalsafame2015-Jun-10 8:22 
AnswerRe: I am having some Problems in Implementing Threads for Listview PinPopular
Luc Pattyn15-Jun-10 8:54
sitebuilderLuc Pattyn15-Jun-10 8:54 
QuestionMesauring paint on a winforms panel Pin
Berlus15-Jun-10 7:18
Berlus15-Jun-10 7:18 
AnswerRe: Mesauring paint on a winforms panel Pin
Luc Pattyn15-Jun-10 7:57
sitebuilderLuc Pattyn15-Jun-10 7:57 
GeneralRe: Mesauring paint on a winforms panel Pin
Berlus15-Jun-10 10:57
Berlus15-Jun-10 10:57 
GeneralRe: Mesauring paint on a winforms panel Pin
Luc Pattyn15-Jun-10 11:22
sitebuilderLuc Pattyn15-Jun-10 11:22 
GeneralRe: Mesauring paint on a winforms panel Pin
Berlus15-Jun-10 19:41
Berlus15-Jun-10 19:41 
GeneralRe: Mesauring paint on a winforms panel Pin
Luc Pattyn16-Jun-10 2:00
sitebuilderLuc Pattyn16-Jun-10 2:00 
GeneralRe: Mesauring paint on a winforms panel Pin
Berlus16-Jun-10 10:02
Berlus16-Jun-10 10:02 
GeneralRe: Mesauring paint on a winforms panel Pin
Luc Pattyn16-Jun-10 10:12
sitebuilderLuc Pattyn16-Jun-10 10:12 
Questionstring matching Pin
arkiboys15-Jun-10 6:56
arkiboys15-Jun-10 6:56 
AnswerRe: string matching Pin
Ravi Bhavnani15-Jun-10 7:00
professionalRavi Bhavnani15-Jun-10 7:00 
AnswerRe: string matching [modified] Pin
Luc Pattyn15-Jun-10 7:05
sitebuilderLuc Pattyn15-Jun-10 7:05 

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.