Reading encrypted data from file

This is a discussion on Reading encrypted data from file within the C Programming forums, part of the General Programming Boards category; Hi, I am reading a file of encrypted data. Unfortunately, reading the encrypted file sometimes prematurely returns EOF. I believe ...

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    1

    Reading encrypted data from file

    Hi,

    I am reading a file of encrypted data. Unfortunately, reading the encrypted file sometimes prematurely returns EOF. I believe that some of the data is encrypting to the EOF character but I'm not sure. Does anyone have any suggestions about how to read all the data in the file? Thanks for your help.

    -C

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,451
    Open the file with a mode of "rb"
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    And stop reading into a char when you're testing it for EOF. Use an int.

    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 08:35 AM
  2. Can we have vector of vector?
    By ketu1 in forum C++ Programming
    Replies: 24
    Last Post: 01-03-2008, 04:02 AM
  3. gcc link external library
    By spank in forum C Programming
    Replies: 6
    Last Post: 08-08-2007, 03:44 PM
  4. reading data from a file
    By brianptodd in forum C++ Programming
    Replies: 1
    Last Post: 11-07-2003, 05:50 PM
  5. what does this mean to you?
    By pkananen in forum C++ Programming
    Replies: 8
    Last Post: 02-04-2002, 02:58 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21