Short Strings - Data Encryption/Decryption

M

Mythran

I have googled and tested and tried and still I can't seem to implement a
simple encryption/decryption console application. My goal is to create two
methods.

public byte[] Encrypt(string DataToEncrypt, string Key)
{
...
}

public byte[] Decrypt(byte[] DataToDecrypt, string Key)
{
...
}


The Key parameter *should* be a variable-length string (an alpha-numeric
password if you will). I'm at a loss at where to go from here...gah!

Any and all help is greatly appreciated,

Mythran
 
M

Mythran

Mythran said:
I have googled and tested and tried and still I can't seem to implement a
simple encryption/decryption console application. My goal is to create two
methods.

public byte[] Encrypt(string DataToEncrypt, string Key)
{
...
}

public byte[] Decrypt(byte[] DataToDecrypt, string Key)
{
...
}


The Key parameter *should* be a variable-length string (an alpha-numeric
password if you will). I'm at a loss at where to go from here...gah!

Any and all help is greatly appreciated,

Mythran

Nevermind ... of course after I post, I find out how :p

Mythran
 
M

Mike C#

I was going to suggest the System.Security.Cryptography namespace. Might be
worth following up if that's not the method you used for your solution.

Mythran said:
Mythran said:
I have googled and tested and tried and still I can't seem to implement a
simple encryption/decryption console application. My goal is to create
two methods.

public byte[] Encrypt(string DataToEncrypt, string Key)
{
...
}

public byte[] Decrypt(byte[] DataToDecrypt, string Key)
{
...
}


The Key parameter *should* be a variable-length string (an alpha-numeric
password if you will). I'm at a loss at where to go from here...gah!

Any and all help is greatly appreciated,

Mythran

Nevermind ... of course after I post, I find out how :p

Mythran
 
M

Mythran

Yeah, I played with the Cryptography namespace and reviewed every provider
class in it...and I just couldn't figure out how to do it until I posted the
2nd post lol...my solution was using the TripleDESCryptoServiceProvider
along with PasswordDeriveBytes classes :)

Mythran


Mike C# said:
I was going to suggest the System.Security.Cryptography namespace. Might
be worth following up if that's not the method you used for your solution.

Mythran said:
Mythran said:
I have googled and tested and tried and still I can't seem to implement a
simple encryption/decryption console application. My goal is to create
two methods.

public byte[] Encrypt(string DataToEncrypt, string Key)
{
...
}

public byte[] Decrypt(byte[] DataToDecrypt, string Key)
{
...
}


The Key parameter *should* be a variable-length string (an alpha-numeric
password if you will). I'm at a loss at where to go from here...gah!

Any and all help is greatly appreciated,

Mythran

Nevermind ... of course after I post, I find out how :p

Mythran
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top