File Operation Changes -sp1 to sp2?

From: Drew Gilkey and Roy Mayhall (Mayhall_at_discussions.microsoft.com)
Date: 01/15/05


Date: Sat, 15 Jan 2005 15:07:02 -0800

Hey guys, been working on an encryption program, in C++, and have ran into
some checksum errors when going between XP SP2 to SP1 and vice versa. Pretty
much when the file is encrypted and I move the same file to a machine running
a different the other SP it will not decrypt. We are sure it is something
with my IO related code and was wondering if there has been any changes
between the service packs that would effect the following:

#include <bitset>
#include <string>
XOR
_lrotr
_lrotl
Any MFC related changes listed below.

Here are also some code snippets of how I am inputing and outputing the file:

// Attempt to open the input file
        infile = CreateFile(filein.c_str(),GENERIC_READ,FILE_SHARE_READ,NULL,
                OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,NULL);
        if (infile == INVALID_HANDLE_VALUE)
        {
                istate = open_failed;
                return false;
        }

        // Determine the length of the input file
        unsigned long pos = 0,size;
        size = GetFileSize(infile,NULL);
        if (size == 0xFFFFFFFF)
        {
                istate = io_error;
                CloseHandle(infile);
                return false;
        }

        // Attempt to create a new file for output
        outfile = CreateFile(fileout.c_str(),GENERIC_WRITE,FILE_SHARE_READ,NULL,
                CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,NULL);
        if (outfile == INVALID_HANDLE_VALUE)
        {
                CloseHandle(infile);
                ostate = open_failed;
                return false;
        }

// readBlock() member function
// Retrieves a large amount of data from the input file to a buffer, to be
processed by
// SYNCLAIR.
__inline bool synclair::readBlock()
{
        blockpos = 0;
        int status = ReadFile(infile,filebuffer,MAX_SIZE,&numread,NULL);
        return status!=0;
}

// writeBlock() member function
// Writes the contents of the file buffer to the output file.
__inline bool synclair::writeBlock()
{
        unsigned long numwritten;
        int status = WriteFile(outfile,filebuffer,numread,&numwritten,NULL);
        return status!=0;
}

We know this is a little cryptic(no pun intended) but these functions are
working on different machines as long as they are the same service pack. The
moment we try encrypting a file on a sp2 machine and decrypting the file on
a sp1 machine it fails to decrypt. The same applies vice versa.

Best Regards,
Drew Gilkey and Roy Mayhall
 
 
 
Expand AllCollapse All
 

Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter
 



Relevant Pages

  • Re: XP2/ Encryption
    ... > folder the encryption is activated. ... In XP SP1 this did not ... and its not a feature of SP2. ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Encryption > access denied after importing key with Certificate
    ... On any XP-Pro pc with SP1 I can export an encrypted folder ... Robert gave me some helpful advise ... basically Garble would be the result & Spot on ... to peer network & encryption ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Encryption > access denied after importing key with Certificate
    ... course weaken XP's encryption. ... > in regards to the problems i can run into when trying to ... > decrypt files which had being encrypted on a Pre SP1 ...
    (microsoft.public.windowsxp.security_admin)
  • RE: Unable to access encrypted files after changing password on NT Domain (SP1)
    ... Unable to access encrypted files after changing password on NT ... Domain (SP1) ... Produced By Microsoft MimeOLE V6.00.2800.1106 ... | the encryption features of XP rather useless in our environment. ...
    (microsoft.public.windowsxp.security_admin)
  • RE: xp sp2
    ... I installed the new SP2 and since I cannot connect to my NETGEAR ... 108MBPS router using the WPA encryption which I had working for a few months ... Failed to install the first round. ... Now fails to connect to wireless router using WEP encryption key. ...
    (microsoft.public.windowsxp.general)