Saturday 15 March 2014

.net - C# byte array to string -


I have read some articles on doing this and I think there is one variable here that I am not considering here.

I am going through somebody else's code, where they have implemented Triple-Day encryption. They do not have a key and iv is stored anywhere in the form of a string. Only in the form of byte arrays

I need to do such encrypt / decrypt call outside C #, so I am trying to find the keys used.

I have tried:

  byte [] key; // It is set byte [iv] // It is set to convert. ToBase64 string (key); (Key) Encoding.Default.GetString; (Key) Encoding.ASCII.GetString; (Key) Encoding.UTF8.GetString; Perhaps the result of one of these is correct, but I need to make another conversion to convert to sign?  

If this is the case, then I am just trying to use these keys with opensl by ruby ​​or node.js.

What is this for, I have tried to make an array of bytes in RUBY and pack one on them, but still looks like the wrong result.

Have you tried using direct hex representation of your byte arrays?

  String KeysHacks = BitCentor.ToString (Key) Change ("-", ""); String ivHex = BitConverter.ToString (iv). Change ("-", "");   

(You may need to prefix the system and / or prefix it with 0x , depending on whether other systems How to boil.)

No comments:

Post a Comment