Jump to content

Creating encryption algorithm, need help with reading binary data

- - - - -

  • Please log in to reply
1 reply to this topic

#1
liamzebedee

liamzebedee

    Programmer

  • Members
  • PipPipPipPip
  • 129 posts
I am creating an encryption algorithm which can read plaintext from a file. I have used
StreamReader and StreamWriter
for basic text file but now I need to read binary data.

I don't want to read binary data with a specific encoding. I am terrible at explaining but the algorithm re-arranges the binary characters and XOR's them similar to AES. How do I read the hex values(no encoding) and XOR them etc.

In C#

#2
gregwarner

gregwarner

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 853 posts
  • Location:Arkansas
I would use the BinaryReader object and the ReadInt32 method, so you can use the XOR operator. Tutorial: C# BinaryReader Tutorial
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.

– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users