Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

C - Reading in an image or exe or any non text file

Options
  • 20-04-2008 2:17pm
    #1
    Closed Accounts Posts: 12,382 ✭✭✭✭


    Hello

    I'm doing a lot of cryptography programming at the moment.

    I've implemented DES, RSA and I'm currently implementing Elliptic Curve Cryptography.

    The basic idea is I read in a text file, encrypt it, and then output the ciphertext.

    Does anyone know how I can read in ANY file type (exe, jpeg, etc.) and perform the same encryption?

    Do I simply read in the files as binary and act as if they're text files, e.g. work on 64 bit blocks of the file, ignoring whether the original data was text or hex or whatever?

    Any advice greatly appreciated.

    Thanks!


Comments

  • Closed Accounts Posts: 12,382 ✭✭✭✭AARRRGH


    ^--- note my question is not encryption specific. I'm just wondering if anyone knows how to read in non-text files and navigate from byte to byte.

    Thanks.


  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    Google fread.


Advertisement