Robert Meek wrote: > I'm trying to work on some encryption algorithms that use byte > variables for inputting the necessary KEY and IV's. Also then the method > takes the original data stream as Bytes as well and after encrypting stores > them as an array. I need to figure a way of using these same algorithms to > encrypt/decrypt strings however. Is there some way of transforming a string > into a byte variable and back again?
AnsiStrings are made up of bytes. Simply extract a character and type-cast it to Byte. Not that if you're using .Net, the string type is an alias for WideString, not AnsiString, and so characters are no longer single bytes. If you can encrypt a stream, then you can encrypt a string by using a TStringStream in place of whatever other steram you might use. -- Rob _______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi

