Re: Encryption/Decryption

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Arvind (arvinds_at_erivasystems.com)
Date: 09/01/04


Date: Wed, 1 Sep 2004 10:11:41 +0530

Thanks a lot for ur reply..

may be i can follow the same ideas in naming the files *.wmv.enc..

can u give me the flow of the program in which i will give input as
C:\\TOENCODE

so that the findfile gets file and send it to encryption and passes on to
next file. till End of file.with same password"hardcoded in encryption
program"

any ideas???

--
Thanks,
Arvind
--
"eRiva Systems" - Where Technology Meets Life, Every Minute.
arvindr@erivasystems.com
www.erivasystems.com
"Don Dumitru [MSFT]" <dondu@online.microsoft.com> wrote in message
news:#JX8GI6jEHA.3348@TK2MSFTNGP12.phx.gbl...
>
> You can change the encryption and decryption programs to accept a wildcard
> specification, and iterate over all of the files that match the wildcard.
> So let's say the the encryption program accepts command lines like this...
>     encryptfiles MySuperSekretPassword1234 Windows\arvind\toencode\*
>
> The program would generate a key based on "MySuperSekretPassword1234", and
> would then call FindFirstFile / FindNextFile against the path
> "Windows\arvind\toencode\*".  For each file it found, it would encrypt it
> based on the generated key.
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base
/findfirstfile.asp
>
> The decryption program would work similarly...
>     decryptfiles MySuperSekretPassword1234 /todecode/*
>
> Again, it would use FindFirstFile / FindNextFile against the supplied
> wildcard path, and apply the decryption process to each file.
>
> One specific thing you should think about:  If the encryption process
> changes the file names from something like test.wmv to test.enc, then how
> will the decryption program know what the name the decrypted file?  The
> filename has been lost - for example, both test.wmv and test.doc would
> generate test.enc, so the decryption program wouldn't know what the name
the
> output.  It if were me, I would probably make it so that the original
> filename was included in the generated file, so that test.wmv would become
> test.wmv.enc.  The decryption program would then look at the filename, and
> strip the ".enc" off to get the name for the output file.
>
> --Don
>
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> "Arvind" <arvinds@erivasystems.com> wrote in message
> news:u3Tdx0xjEHA.3476@tk2msftngp13.phx.gbl...
> > My design goal is simple..
> >
> > i want to change the file extension and encode the content..
> >
> > in encrpting
> >
> > Windows/arvind/toencode/
> >
> > 1.wmv
> > 2.wmv
> > test.wmv
> >
> > Thse are the 3 files in side "toencode" folder
> >
> > i want to pass the parameters such as
> >
> > \Windows\arvind\toencode\
> >
> > i want application to encode all the 3 files to same password and change
> > its
> > extension
> >
> > to
> >
> > 1.enc
> > 2.enc
> > test.enc
> >
> > The same i want to do the same in reverse process for the decryption at
> > pocket pc level
> >
> > 1.enc
> > 2.enc
> > test.enc
> >
> > TO
> >
> > 1.wmv
> > 2.wmv
> > test.wmv
> >
> > and sore it in a same directory
> >
> > is there any way for this?
> >
> > i couldnt find any guide in this regard
> >
> > --
> > Thanks
> >
> > Arvind
> >
> >
> >
> > --
> > "eRiva Systems" - Where Technology Meets Life, Every Minute.
> >
> > arvindr@erivasystems.com
> >
> > www.erivasystems.com
> >
> > "Don Dumitru [MSFT]" <dondu@online.microsoft.com> wrote in message
> > news:#xo6tStjEHA.3664@TK2MSFTNGP11.phx.gbl...
> >> For encrypting / decrypting multiple files at once, I assume that you
> > would
> >> need to change the programs.  If your design goal really is to process
> > *all*
> >> of the files in the folder, then you would use FindFirstFile /
> > FindNextFile
> >> to iterate through the files.  On the other hand, your design goal
might
> > be
> >> to process the list of files which are named on the command line of the
> >> program, in which case the program would examine its command line
> > arguments,
> >> and apply the encrption / decryption to each of the filenames passed on
> > the
> >> command line.
> >>
> >> --Don
> >>
> >>
> >> --
> >> This posting is provided "AS IS" with no warranties, and confers no
> > rights.
> >>
> >> "Arvind" <arvinds@erivasystems.com> wrote in message
> >> news:%23F1Vw5ljEHA.1048@tk2msftngp13.phx.gbl...
> >> > your right!
> >> >
> >> > Now the problem is fixed and its working fine..
> >> >
> >> > now i have 2 applications (desktop/pda)
> >> >
> >> > and one more thing..can i do the encryption of list of files present
in
> >> > the
> >> > folder
> >> >
> >> > like
> >> >
> >> > test.abc
> >> > test1.abc
> >> > etc
> >> >
> >> > to
> >> >
> >> > encrypt serially one by one?
> >> >
> >> > and same for decrypting one by one automatically
> >> >
> >> > how can we do that?
> >> >
> >> > --
> >> >
> >> > Thanks,
> >> >
> >> > Arvind
> >> >
> >> > --
> >> > "eRiva Systems" - Where Technology Meets Life, Every Minute.
> >> >
> >> > arvindr@erivasystems.com
> >> >
> >> > www.erivasystems.com
> >> >
> >> > "Don Dumitru [MSFT]" <dondu@online.microsoft.com> wrote in message
> >> > news:OaZxk9LhEHA.596@TK2MSFTNGP11.phx.gbl...
> >> >> From the thread going on in the
microsoft.public.windowsce.embedded.vc
> >> >> newsgroup, I am going to assume that this is getting resolved as an
> > issue
> >> > of
> >> >> using an ANSI pass-phrase on the desktop, and a Unicode pass-phrase
on
> >> >> the
> >> >> device.
> >> >>
> >> >> --Don
> >> >>
> >> >> --
> >> >> This posting is provided "AS IS" with no warranties, and confers no
> >> > rights.
> >> >>
> >> >>
> >> >> "Don Dumitru [MSFT]" <dondu@online.microsoft.com> wrote in message
> >> >> news:OPB1KmLhEHA.904@TK2MSFTNGP09.phx.gbl...
> >> >> > Can you provide the full URL for the sample, so I can be sure that
> >> >> > we
> >> > are
> >> >> > looking at exactly the same thing?  Without it, I don't know which
> >> > actual
> >> >> > sample you might be looking at, and I can only guess at what
> >> >> > problems
> >> > you
> >> >> > are having, and I won'd be able to reliably reproduce the behavior
> >> > myself.
> >> >> >
> >> >> > From your description, it sounds like the sample works by
generating
> > an
> >> >> > RC4 key into a key container for the user, and then encrypting /
> >> >> > decrypting the file using that key.  I am guessing here, but...
You
> >> >> > run
> >> >> > an "init user" app on both the sender and the receiver, and give
it
> > the
> >> >> > same pass-phrase?  And it generates an RC4 key and places it in
the
> >> > user's
> >> >> > key container?  You then run an encryption program, which uses the
> >> > stored
> >> >> > key to encrypt a file.  You move the file to the other machine,
and
> > run
> >> >> > the decryption program, which accesses the stored key and decrypts
> > the
> >> >> > file.
> >> >> >
> >> >> > That's what it sounded like it was doing.
> >> >> >
> >> >> > The first thing to verify would be that you can decrypt the file
> >> >> > successfully, on the desktop, without Windows CE involved.  The
next
> >> > thing
> >> >> > to do is to build the "init user" app for Windows CE, and run it,
> >> >> > and
> >> > see
> >> >> > if it succeeds.  Ideally, you would single-step through with a
> >> >> > debugger,
> >> >> > and examine each error return, in case the application itself does
> > not
> >> >> > adequately report some error that it receives.  Finally, you need
to
> >> > build
> >> >> > the decryption program for Windows CE, run it, and again hopefully
> >> >> > single-step through it to examine error codes which might be
getting
> >> >> > returned from various API's.
> >> >> >
> >> >> > From your description of how the app's are supposed to work, I
would
> >> > look
> >> >> > closely at how the "init user" and decryption programs access the
> >> >> > RC4
> >> > key
> >> >> > stored in the key container.  Since Windows CE has a different
user
> >> > model
> >> >> > than the desktop, and since key containers are associated with
> >> >> > users,
> >> > this
> >> >> > is an area where the app could be getting different behavior than
it
> >> >> > was
> >> >> > expecting.  The most likely case is that some error is being
> > returned,
> >> > and
> >> >> > the app simply isn't checking the error code, and blindly cruising
> >> >> > along
> >> >> > as if the API had succeeded.
> >> >> >
> >> >> > --Don
> >> >> >
> >> >> >
> >> >> > "Arvind" <arvinds@erivasystems.com> wrote in message
> >> >> > news:%23yBu2MBhEHA.3964@TK2MSFTNGP12.phx.gbl...
> >> >> >>i got it from www.msdn.com
> >> >> >>
> >> >> >> basically theres 2 applications..
> >> >> >>
> >> >> >> desktop for encrypting
> >> >> >>
> >> >> >> pocket pc for decrypting..
> >> >> >>
> >> >> >> ive used RC4 to encrypt and using the same to decrypt..
> >> >> >> but im getting the wrong output file.
> >> >> >>
> >> >> >> i have used the inituser for client for storing and generating
> >> >> >> keys(Container)
> >> >> >>
> >> >> >> but i couldnt find the same init user application for pocket pc
> >> >> >>
> >> >> >> can i get one?
> >> >> >>
> >> >> >> --
> >> >> >> Thanks,
> >> >> >>
> >> >> >> Arvind
> >> >> >>
> >> >> >>
> >> >> >> --
> >> >> >> "eRiva Systems" - Where Technology Meets Life, Every Minute.
> >> >> >>
> >> >> >> arvindr@erivasystems.com
> >> >> >>
> >> >> >> www.erivasystems.com
> >> >> >>
> >> >> >> "Don Dumitru [MSFT]" <dondu@online.microsoft.com> wrote in
message
> >> >> >> news:#5ujxoYgEHA.1356@TK2MSFTNGP09.phx.gbl...
> >> >> >>> Can you provide a URL for the sample which you used?  Was it a
> >> > specific
> >> >> >>> Windows CE sample, or a more general Win32 sample?  Presumably,
> > some
> >> >> >>> function call is failing, and the sample isn't reporting the
> > failure.
> >> >> >>>
> >> >> >>> --Don
> >> >> >>>
> >> >> >>> --
> >> >> >>> This posting is provided "AS IS" with no warranties, and confers
> >> >> >>> no
> >> >> >> rights.
> >> >> >>>
> >> >> >>>
> >> >> >>> "Arvind" <arvinds@erivasystems.com> wrote in message
> >> >> >>> news:u1BRZURgEHA.2764@TK2MSFTNGP11.phx.gbl...
> >> >> >>> > Hello,
> >> >> >>> >
> >> >> >>> > im trying to use crypto API's in pocket pc (EVC++)
> >> >> >>> >
> >> >> >>> > to encrypt the WMV Files and decrypt the same.
> >> >> >>> >
> >> >> >>> > what i did is just copied the sample application which is
> > provided
> >> > in
> >> >> >> the
> >> >> >>> > help and tried to run in the pocket pc
> >> >> >>> >
> >> >> >>> > the application for encryption creates the destination file
but
> > the
> >> >> >>> > content
> >> >> >>> > are not added in that..
> >> >> >>> > (File shows 0 BYTES)
> >> >> >>> >
> >> >> >>> > is there any other way around i have to try?
> >> >> >>> >
> >> >> >>> > plese let me know ur ideas..
> >> >> >>> >
> >> >> >>> > --
> >> >> >>> > "eRiva Systems" - Where Technology Meets Life, Every Minute.
> >> >> >>> >
> >> >> >>> > arvindr@erivasystems.com
> >> >> >>> >
> >> >> >>> > www.erivasystems.com
> >> >> >>> >
> >> >> >>> >
> >> >> >>>
> >> >> >>>
> >> >> >>
> >> >> >>
> >> >> >
> >> >> >
> >> >>
> >> >>
> >> >
> >> >
> >>
> >>
> >
> >
>
>


Relevant Pages

  • Re: Auto-update protocol
    ... to transfer even with a single client and no interference. ... shared secret/public key is the only way to do the encryption. ... successfully decryption is the authentication. ... you can get using a generic farm server, but TFTP does not have any ...
    (comp.arch.embedded)
  • Re: Securing data to a process principal
    ... encryption key first time for the user - and use it later). ... secret. ... I need the decryption to ... You MAY think that instead of a filter driver you can simply ...
    (microsoft.public.platformsdk.security)
  • Re: embedded keys - there has to be a less vulnerable approach
    ... the database would be run on top of an encrypting file system ... > The use of an asymmetrical encryption algorithm does not seem to offer ... because the encryption and decryption ... > a hostile attacker is not a member of that small knowledgeable elite. ...
    (comp.security.misc)
  • embedded keys - there has to be a less vulnerable approach
    ... the database would be run on top of an encrypting file system ... The use of an asymmetrical encryption algorithm does not seem to offer ... because the encryption and decryption ... You have a table with customer names and addresses. ...
    (comp.security.misc)
  • NTE_BAD_DATA
    ... decryption module using the self signed certificate. ... My encryption and decryption module are as follows. ... goto Exit_MyDecryptFile; ... // imported from a BLOB read in from the source file or having ...
    (microsoft.public.platformsdk.security)