2

I am using TripleDESCryptoServiceProvider to encrypt a series of bytes in C#. The key which is passed to me is in like this FFC7B905AD6ACB57D662115FD65FA338 which i believe is a hex. How can i get this value into TripleDESCryptoServiceProvider.Key property which accepts a byte array or how do i copy this value to a byte array so that i can pass to key property.

Thanks in advance,

John

logeeks
  • 4,849
  • 15
  • 62
  • 93

1 Answers1

3

Just parse the hex to a byte array - nothing to do with encryption, really.

There are lots of bits of sample code to do that here on Stack Overflow, including my answer here.

(Not closing this question as a duplicate, as it's not quite a duplicate - it's really about understanding that it's a matter of parsing to a byte array first.)

Community
  • 1
  • 1
Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194