CFXWorks-Coldfusion: Encryption, Secure Messaging and Credit Card Processing
[FREE PRODUCTS] - CFX_BASE64 - Simple Tag Example
This example requires you to download a demo version of CFX_Base64.
 

We have attempted to provide a fairly simple example of how you might use this tag going against an Access database file. You do not need to have Access running on your computer. You will, however, have to register the database file in the Coldfusion Administrator. Also, if you are using Coldfsion Studio you will have to add a correct mapping for this file.

 
Information on the CFX_Base64 example:
 

This page is intended to help ColdFusion developers understand how to use the following CFXWorks' Custom tag: CFX_Base64.

 

The CFX_Base64 tag, allows you to send data across the Internet, that includes: "special characters", "reserved characters" or characters within the Extended ASCII character set (characters represented by decmial numbers 128-255)? Why would you want to do this? For example, the Extended ASCII character set is used to represent industry specific, mathematical, graphic and foreign characters. Only approximately one-third of all the characters that can be represented within computer memory, can be "safely" transmitted across the Internet.

 

The Base64 Content-Transfer-Encoding is designed to represent arbitrary sequences of octets in a form that need not be humanly readable. The encoding and decoding algorithms are simple, but the encoded data are consistently only about 33 percent larger than the unencoded data. This encoding is virtually identical to the one used in Privacy Enhanced Mail applications, as defined in RFC 1421. The Base64 encoding is adapted from RFC 1421, with one change: Base64 eliminates the "*" mechanism for embedded clear text. A sixty five character subset of US-ASCII is used, enabling 6 bits to be represented per printable character. (The extra 65th character, "=", is used to signify a special processing function.)

 

An important property of Base64 encoding is that it is represented identically in all versions of ISO 646, including US ASCII, and all characters in the subset are also represented identically in all versions of EBCDIC. Other popular encodings, such as the encoding used by the UUENCODE utility and the Base85 encoding specified as part of Level 2 PostScript, do not share these properties, and thus do not fulfill the portability requirements for a binary transport encoding for data that must be safely transmitted across the internet.

 

This Readme page does not get into detailed specifics on how to use the tags mentioned above. It is intend to be a very simple example, that should allow you to look at the ColdFusion code to determine how this tag might be used in your own programming effort. If you are interested in a more technical overview of each of these tags, please refer to the PDF documentaion that is included in the demo zip file.

 

For simplicity, we created a Microsoft Access Database file (base64.mdb) to be used with this example. This database has only two columns: customerID and cc_number. The assumption of this example is that you are trying to enter a customers credit card information and you want to use BASE64 technology to encode this information and store it in a database. The Administrative screen shows you a representation of a creditcard number prior to using Base64 and after using Base64.

 
customer administration
customerID cc_number cc_number (base64) controls
1001 1111222233334444 MTExMTIyMjIzMzMZndq0NA= edit | delete
 
Ideas on ways to uses CFX_Base64
 
  • To encode binary data so it can be safely sent across the internet.
  • To enable printing of encoded data.
  • To hide data from prying eyes.
 
Items that you need to do in order to run this example:
 

1). If you are not already registered on the CFXWorks-Coldfusion web site, please do so. If you have already registered, please enter your username and password. Once you have logged on, navigate to the products tab.

 

Select cfx_tags. Now navigate to the cfx_base64 tag. Enter a value for quantity, i.e., "1". Selct the "demo" button. Scroll to the bottom of the page and select check out. Continue filling out specified information. When you get to the download dialog box you should see something that looks like the following: cfx_ base64 - 1111_222222_3333_4. Click on the product number of this item to begin downloading.

 

2). After downloading the demo tag to you local computer, unzip the file. Please note that when you attempt to unzip this file you will be asked for a password. This is the same password that you used to log into the CFXWorks-Coldfusion website.

 

3). Copy "cfx_base64.dll" to your cfusion\customtags directory. Next, register the cfx_base64.dll as a custom tag in your ColdFusion Administrator. If your not sure how to register a custom tag, please refer to the PDF documentation as stated above or your ColdFusion documentation.

 

4). Next, you need to create an ODBC datasource for our sample database. If your not sure how to do this, please refer to the PDF documentation as stated above or your ColdFusion documentation.

 

5). If you are using ColdFusion Studio, create a Development Mapping for the unzipped sample .cfm files. You should have the following files:

 
  • ADMIN_base64.cfm
  • AU1_base64.cfm
  • AU2_base64.cfm
  • DEL_base64.cfm
  • base64.mdb
  • base64.ldb
 

6). If you have completed the above steps correctly, you should be able to select the "ADMIN_base64.CFM" file and the sample "BASE64 Administration" dialog box should appear. It show appear like the following:

 
customer administration
customerID cc_number cc_number (base64) controls
1001 1111222233334444 MTExMTIyMjIzMzMZndq0NA= edit | delete
 

If you do not have a copy of Microsoft Access running on your computer, but would like to know how we defined the columns in our sample database (base64.mdb) the following table might be helpful:

 
Column Name Type Lenght
customerID text 10
cc_number text 24
 

If you are trying to decide how to setup your database, one piece of information that might be helpful is, the length of the field you are trying to encode should follow the following general rule: The size of base64 encoded data will be at a maximum, 1/3 larger (rounded to a 4 byte binary) than the original data.

 
To download a zipped copy of this example please, click the following icon:
 

CFX_Base64:

  • Installation &
        User Guide
  • Get Tag Now
  • CFX_Checkemail:

  • Installation &
        User Guide
  • Get Tag Now
  • CFX_Hex:

  • Installation &
        User Guide
  • Get Tag Now
  • CFX_Base64
    CFX_Checkemail
    CFX_Hex
       © 2017 CFXWorks Inc. All rights reserved. Sitemap |   Login | Home |   Contact | Privacy | Legal