Encrypt Context [Encrypt seed=abcd]Any Text[/Encrypt]
Encrypts text using a variety of standard methods.

To convert text from plain to encrypted, put it inside an [Encrypt] context.

Example (normally you would put the following text into a .tpl file on your server and use a web browser to link to it):

[Encrypt seed=abcdefg]Some Text that is private[/Encrypt]<br>
[Decrypt seed=abcdefg][Encrypt seed=abcdefg]Some Text that is private[/Encrypt][/Decrypt]

In the example above, the first line of displayed text will be unintelligible, as seen below. The second line decrypts the text and displays it as it was before:

;)(*&#$KLJFLKjkhegdlksdfg09814
Some Text that is private

Use [Decrypt] to decode the text. To decrypt a sequence of text, you must set the seed value to exactly the same as when you encrypted it. The seed may be a sequence of up to 8 characters (anything you can type on the keyboard, except '&' or '=' or '[' or ']'). Do not ever let anyone know what the seed value is, because that would allow them to decrypt the text.
IMPORTANT: [url][/url] / [unurl][/unurl]'ing conventions ensure a proper decrypt value!
typeratio [url]'s to [/unurl]'sexample
Variables 1 to 1
[text]var=some value[/text]
[text]var=[url][encrypt seed=xxxx][var][/encrypt][/url][/text]
					
[decrypt seed=xxxx][unurl][var][/unurl][/decrypt]
Databases 2 to 1
[text]var=some value[/text]
[append db=some.db]id=1&db_value=[url][url][encrypt seed=xxxx][var][/encrypt][/url][/url][/append]

[search db=some.db&eqIDdatarq=1]
	[founditems]
		[decrypt seed=xxxx][unurl][db_value][/unurl][/decrypt]
	[/founditems]
[/search]
Cookies 2 to 0
[text]var=some value[/text]
[setcookie name=thecookie&value=[url][url][encrypt seed=xxxx][var][/encrypt][/url][/url]]

[decrypt seed=xxxx][getcookie name=thecookie][/decrypt]
Orderfile 2 to 1
[text]var=some value[/text]
[setheader cart=[cart]]header40=[url][url][encrypt seed=xxxx][var][/encrypt][/url][/url][/setheader]

[orderfile cart=[cart]]
[decrypt seed=xxxx][unurl][header40][/unurl][/decrypt]
[/orderfile]

This context is most often used to store passwords in a database (such as WebDNA's own Users.db), so that in the unlikely event that someone is able to download the file, the passwords will be unreadable.

Note: Do not ever forget your passwords or seed values! Even WSC cannot decrypt something once it has been encrypted!

You may optionally choose different special-purpose encryption methods as described in the following table:
 Parameter  Description
method
(Optional) "CyberCash", "APOP", or "Base64". If not specified, then standard WebDNA encryption is assumed. CyberCash is the triple-DES encryption used to communicate with the CyberCash CashRegister servers. Base64 is the encoding (not safe for encryption) standard HTML browsers use for Basic Authentication. APOP is the MD5 encryption used by email servers that support APOP authentication.
seed
(Required, except for Base64) Key used to encrypt the text. For CyberCash, this should be the MerchantKey you were assigned when you created a CyberCash merchant account. For standard WebDNA encryption, this is your secret key for decryption later. CyberCash encryption is one-way; it cannot be decrypted by your server.
file
(Optional) Specifies a file that is to be encoded using Base64. This is useful for sending e-mail attachments using the WebDNA sendmail context. Note that anything between the opening and closing encrypt tag will be ignored if this parameter is present.
Note: This only applies to WebDNA version 4.0.2rc1 and above.
emailformat
(Optional) For Base64 only, this specifies if the resulting encoded string should contain line breaks suitable for e-mail applications. Valid values are either 'T' or 'F' the later being the default. This should be used in conjunction with the file parameter when sending e-mail attachments from a WebDNA template.
Note: This only applies to WebDNA version 4.0.2rc1 and above.

User Contributed Notes
EncryptContext  

Copyright © 2008 WebDNA Software Corporation, Inc.