The reason I'm not using Delphi's, or for that matter, the
encryption libraries I already Have for Delphi, is that I wanted something I
could use in common across the board. And yes, I again got the clr and the
framework mixed up...I do that at least ten times a day! <g> I do the same
with units, files, and namespaces! <g>
The thing is, the stream methods as in my last message, will do fine
in those instances where for example, encryption is turned on by a user
while working in a memo, however the template I'm working on right now is
for one-time-per session use only. What I've been doing, and so far this
has worked really well for me in Delphi Win32 apps, is to install the app
and at the same time make an encrypted entry into the Local machine root of
the Registry. I add an encrypted version of the app's CrC, and another of
the date and time it is installed. Each time the app is started, and no
matter what user is currently logged on, these two values are checked. If
they don't exist, the app is terminated. If they do, then a new CrC is
made, the stored one decrypted and a comparison done. If not the same the
app is terminated. The start date allows the same for checking a 30 day
shareware use privilege. I generate the Key and IV before the app is
finished, using a utility I created for this, and they are themselves
encrypted and stored in sections in various parts of the application. And
they are put back together using a number of different calls also in various
parts of the application. They are hidden inside real procedures that under
this one condition can also run as dummies just for this purpose, making
them very difficult to find even if the app is decompiled! I know it's not
perfect or foolproof, but I figure anytime you can throw a curve into the
mix it's to your own advantage, especially when any canned solutions you can
purchase are always well known and hacked by the time they reach the open
market anyway.
from: Robert Meek at: [EMAIL PROTECTED]
dba "Tangentals Design" home of "PoBoy"
freeware Windows apps and utilities
located at: www.TangentalsDesign.com
Proud to be a moderator for the
"Delphi Programming Lists" at: elists.org
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Rob Kennedy
Sent: Wednesday, November 09, 2005 12:32 PM
To: Borland's Delphi Discussion List
Subject: RE: Bytes, strings, and streams
Robert Meek wrote:
> Actually I am using NET and the algorithms I'm trying to use are
> those provided by the clr.
I think you're confusing the Common Language Runtime with the .Net
Framework class library. The class library is what provides algorithms and
classes. The CLR just provides a run-time environment -- memory manager,
security enforcement, exception handling, etc.
The .Net Framework's stream classes aren't as convenient as Delphi's. You
paid for Delphi; you may as well use what it provides.
> It seems to have available just about anything
> I
> might need except as I said they all work with a MemoryStream and byte
> variables. I tried typecasting but that didn't seem to work and I don't
> know if I can substitute a different stream type...but I'll give it a try
> and see what happens. One thing though, it seems a terrible waste to use
> a
> stream just for a single string of perhaps 8 chars, but I haven't had any
> luck finding any specific string handling encryption routines...good
> ones...that can be used in NET except for paid libraries.
On the introductory help page for MemoryStream, there is an example that
takes a string and puts it onto a stream. It uses the UnicodeEncoding
class to convert strings into byte arrays, and then it writes those arrays
to a stream.
Any string-encrypting function you find will have to convert the string
into a byte representation, do numeric operations on those bytes, and then
possibly convert the bytes back into some kind of string representation.
If you find that it makes any difference, maybe you keep the
UnicodeEncoding and MemoryStream instances available for repeated uses of
your encryption function to avoid having to create them anew each time.
--
Rob
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi