Cryptograhy

JB sundown at pacifier.com
Tue Aug 5 21:32:51 EDT 2014


I was testing base64 and the Pack function
written by Richard Gaskin and after packing
and unpacking the data appears the same
but does not properly write to a file.

For instance I have a image that I read as a binary
and put the info in a field.  Then I base64Encode it
and put the date into a field.  I am able to take the
encoded data and use base64Decode which will
decode it to its original form and I am able to write
that data to a file and I have the original image.

When I use the Pack function it does the same thing
but adds a password if you want it and encrypts it.

After I unPack the date the date looks the same as
the original but when I write the date to a file I end
up with a corrupted file and cannot view the image.

Does anyone know why the file gets corrupted?  I
have the same problem when I use base64Encode
and convert the encoded ascii data to hex and back
to ascii then decode it.  The data looks the same but
I end up with a corrupted file.

-=>JB<=-




More information about the use-livecode mailing list