Data encryption

Encrypt (web::encrypt) and decrypt (web::decrypt) data. By default, the built-in, weak encryption is used. encryption is extensible by plug-Ins. The encryption module tries all plug-Ins from a list until the first plug-In was able to en-/decrypt the input. See web::config for the configuration of the plug-Ins to be used.

web::encrypt

web::encrypt data

Returns encrypted data.

web::decrypt

web::decrypt data

Returns decrypted data.

Example 15. web::encrypt

% web::encrypt "Hello, world!"
XDIVAhkgkxRjcfA7UTwpD7
% web::decrypt [web::encrypt "Hello, world!"]
Hello, world!
%	  


Encryption plug-in D

web::encryptd

By default, Websh uses this plug-In for weak data encryption for encryption (web::encryptd) and decryption (web::decryptd). The encryption key is managed with web::crpytdkey.

web::encryptd data

Returns encrypted data.

web::decryptd

web::decryptd data

Returns decrypted data.

web::cryptdkey

web::cryptdkey ?key?

Sets the new key for encryption. If no argument is given, resets to the default key. This command does not return the currently active key, in difference to other configuration commands of Websh.

Encryption plug-in interface

For plug-in developers only

The encryption plug-in is required to implement the interface described below (note that to activate your plugin, use web::config encryptchain and web::config decryptchain respectively):

  • web::yourencrypt accepts one argument web::yourencrypt takes a string as input and generates a string which must be URI compliant.
  • web::yourdecrypt accepts one argument web::yourdecrypt takes a string as input and returns a string.
  • symmetry: $in == [web::yourdecrypt [web::yourencrypt $in]]
  • error messaging: TCL_OK for success. TCL_ERROR for any error during en-/decryption. TCL_CONTINUE for unknown encryption type (pass on to next method).