# Encrypt 24 byte array into 8 byte array in c#



## cnr.chada (Apr 1, 2010)

Hi,

I have an 24 byte array and would like to convert into 8 byte hash code in c# .

I would really appreciate for your help

Thanks,
chinna


----------



## Kreij (Apr 1, 2010)

I believe the original DES encryption encrypts into 8 byte blocks. I've never use it though.
It's rather slow and insecure.


----------



## FordGT90Concept (Apr 1, 2010)

SHA1 and MD5 are hashes.  They are lossy.  TripleDES and Rijndael (Rijndael is more secure) encrypt data.  To make an 24 byte array only 8 bytes without losing any data, you need compression algorithms like the ZIP deflate method.  How many bytes you get out of compression algorithms depends on how dense the input 24 byte arrays are.


So basically...
"encrypt" = TripleDES/Rijndael
"24 byte array ... into 8 byte array" = compression/deflate algorithms


----------

