[REBOL] Re: Encryption/Decryption
From: holger:rebol at: 5-Jul-2001 17:31
On Thu, Jul 05, 2001 at 02:31:58PM -0400, [ptretter--charter--net] wrote:
> I have a problem with a script I'm working on and can't figure out
> why it doesn't work right. The problem is that it wont decrypt the
> file after encrypting it. See script below. Any suggestions? BTW:
> this is a crude script at the moment.
You are trying to change the 'direction field in your port after creating it.
This is not possible. All fields have to be set to their proper values at the
time the port is created. You could try something like this (not tested though):
crypt-port-spec: [
scheme: 'crypt
algorithm: 'blowfish
direction: 'encrypt
strength: 128
key: crypt-key
padding: true
]
...
toggle "Encrypt" "Decrypt" [
change next find crypt-port-spec to-set-word 'direction pick [decrypt encrypt] value
]
...
crypt-port: make port! crypt-port-spec
--
Holger Kruse
[holger--rebol--com]