none
Own C# Cryptoalgorithm RRS feed

  • Question

  • Hello there,

    I got a problem with C# and Visual Studio when I tried inventing my own Cryptoalgorithm. The Reason why I make my own Algorithm is very hard to understand and it lies in the unimportant background.

    I tried finding Solutions to this problem but nothing were ok. I want to convert a string into a byte[] but the compiler shows me always an error message. It is very annoying... My friend and Java Programmer told me that way for my own Cryptoalgorithm but I'm not sure to say that it could be right. While nothing worked I got the idea to post here.

    Perhaps you know a way to convert a string into a byte[], I would be happy at all :-)

    I'm very sorry for my disappointing English but I'm just a 17 years old German student and I do my best ;-)

    Greetings CsProgrammer
    Friday, August 8, 2008 11:33 AM

Answers

  • See if this helps:
            public static byte[] StringToBytes(string text) { 
                System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); 
                return encoding.GetBytes(text); 
            } 


    • Marked as answer by jack 321 Tuesday, August 12, 2008 5:23 AM
    Friday, August 8, 2008 12:15 PM