CryptPad Program

Encrypting Editor Notepad Replacement

C# .Net 3.5 (Windows 7)
Windows Forms Application
with source code

Version 2.3

/Home /Professional /Papers /CryptPad

Older Cryptpad Program Version 2.2

Newer Cryptpad Program Version 2.4


Download Program and Source

CryptPad.zip

CryptPad-SourceOnly.zip


Contents

Introduction

I love Windows Notepad! I write all my HTML, Jscript, CMD scripts, and much more in Notepad. It is my favorite editing tool. It is fast and simple. So, why would I write a replacement program?

The primary purpose of the CryptPad program is to provide optional file encryption. This is valuable for files which contain sensitive information. Unlike many other encryption solutions, this one requires no installation, is very simple, and non-intrusive on the operating system. CryptPad only encrypts and decrypts one file at save and open. There is never a decrypted version of the file stored unless the operator specifies to remove the encryption. The file can be stored multiple places and moved freely like any other file, but always in encrypted form. Anyone who knows the encryption string can read the file with this program.

You may refer to the section on Encryption for additional details.

It is important, for better security, to use different passwords on each website you visit. In order to maintain these multiple passwords, I have a file with all the passwords in it that I use. This is also a security risk unless the file is encrypted. I have examined many encryption solutions and none does exactly what I need. I need to be able to transport and store an encrypted file anywhere I want. Encrypted drives are not what I need. The file must never exist in decrypted form. Therefore I need a simple editor which opens, decrypts, edits, encrypts, and saves a file.

You might notice my use of the word "operator". I am a little uncomfortable with the word "user". I am deeply steeped in the computer industry having worked over 40 years with computers since about 1971. I remember the use of the word "luser" (loser) by those educated ignoramuses who considered their priesthood as above the lowly computer user. There is also the unfortunate association with the phrase "drug user". Sensitivity may not be considered a "manly" trait but I treasure and practice this characteristic. I evaluate the use of words just as carefully as I evaluate the computer software I use and write.

Notice that I do not at any point describe CryptPad as a Notepad clone. A clone is an exact copy. Notepad has some very specific functionality, which I have not seen anyone duplicate completely. For example, the Undo function of Notepad has not been properly implemented in most advertised "clones". Undo is implemented wherever practical in CryptPad. I have also not seen a "clone" which properly implements UTF-8 and Unicode conversions or reads files with ANSI characters as Notepad and CryptPad do.

CryptPad is intended to be nearly the same as Windows 7 Notepad. I have chosen not to include some functions which I do not consider useful or important such as printing. I almost never use paper or printing! Those rare occasions when I might want to print I can just use Notepad. CryptPad is not a "clone" but is close enough to be a useful replacement. Now that I have created the source code for a replacement for Notepad, I have been adding functions useful in my daily editing work.

I also have a major problem with Notepad because it allows a problem called parallel update. Unlike Notepad, CryptPad maintains the file in an opened state locked against parallel changes but shared with file readers. This protects the file against accidental parallel modification data loss problems. I have had this happen to me on occasion with Notepad. You can still lose changes but it will have to be by deliberate actions and not by casual accident.

I hope you find the CryptPad program useful. I am interested in any problems you may find in the program and in particular any incompatibility as a Notepad replacement. I am also interested in your ideas about improving this simple program. I intend to keep the program as small and simple as practical. CryptPad will always be a switchblade not a Swiss Army knife.

I continue to use, modify, and test the CryptPad program. I will return periodically (about once a month or so) to update this article and the source code with the latest fixes, improvements, and tweaks.

ASCII, ANSI, UTF-8

As you read about this program, you might like to ask me a question. What in the world is all this UTF-8 and Unicode nonsense!?

In the old days of microcomputers (about 1980), it was simple. (It wasn't really. Remember EBCDIC? But we will pretend it was simple.) All text files were 7 bit ASCII (American Standard Code for Information Interchange) characters. Notice the word "American" in ASCII. There are many people in the world, with many different languages and characters, and they need to be represented in daily computer use. There are also additional "American" characters in common use beyond plain ASCII.

There is a great deal of confusion about the subject of character encoding. If you are a detail oriented person and prepared for a heavy read, you can start here:

http://en.wikipedia.org/wiki/UTF-8

I will try to make it short and simple. When you are using typical ASCII characters, strict UTF-8 (without a BOM) is exactly the same thing. Most of your editing will be simple ASCII. This entire webpage is only ASCII. In most cases, you can just stop here.

The exception is for non-English languages and if you ever use characters such as Microsoft Word smart quotes and apostrophes. These are the "curved" typographical equivalents of the simple "straight" ASCII quote and apostrophe. The apostrophe has a curve and there is a different curve for beginning and ending a quote. There are many other types of special characters. Many of the other languages also require special characters.

There are two primary ways to represent these types of non-ASCII characters. The older way is with 8 bit characters. This is when you see "Windows-1252" or other non-Unicode encodings. These encodings can be very complex and plagued with limitations. Notepad refers to this as "ANSI" encoding. Unicode makes the process simpler (but not simple) to support everybody's characters. UTF-8 was invented to support ASCII with no changes and optionally extend to Unicode characters using pairs or clusters of 8 bit characters.

If this short explanation made you curious to know more, then you are back to the heavy reading I mentioned earlier. You may also refer to the section on Encoding for additional details.

Installing the Program

An important feature of this editor is that it does not require a blind install program or administrator permission. I am using the term "blind" to refer to the fact that the extent of the changes made by the typical install program are completely hidden from you. I don't like things that are hidden.

The CryptPad program is completely stand-alone so a simple copy is the minimum needed to permanently "install" and use the program. You can carry it on a USB flash drive and use anywhere. You can use it temporarily, anywhere, and immediately with no install, no permissions, and no problems directly from the USB flash drive.

At this point I should mention that the CryptPad program uses standard .NET persistent settings. These settings are stored in a file named user.config, which is kept in a directory with a name similar to "%LOCALAPPDATA% (C:\Users\%USERNAME%\AppData\Local) \Frank_T_Clark_Software\CryptPad.exe_Url_*\2.3.0.0\". These settings are kept in a separate unique directory depending on the version and where the program is run from.

The permanent CryptPad program "installation" location is recommended for a CryptPad directory under the Documents directory for an individual operator. This would be a directory named "%USERPROFILE% (C:\Users\%USERNAME%) \Documents\CryptPad". Just create the directory and copy the program into place. You could download the CryptPad.ZIP file to the Documents folder and extract into this directory. The download provides a documentation/help file, image file, and useful scripts, which can also be placed in this directory. The help file is also available online and may contain additional updated information.

If you wish, "Open With" can be set to default to CryptPad for the .SAFE encrypted files created by CryptPad. You might choose to set the default "Open With" to CryptPad for .TXT also to take advantage of the additional editing functions.

I do not provide a blind install program because I want you to know for absolute certain exactly what is required to use the program. Uninstall is very simple. Erase the program! Most Setup programs mysteriously make unknown changes to your computer. I won't even blindly change the registry for you. I do provide a readable CryptPadInstall.CMD script and a CryptPadAdd.REG file, which illustrates an install procedure you can use.

The CryptPadAdd.REG file used by the CryptPadInstall.CMD script contains all kinds of settings I use to make CryptPad the default editor. These have been used and tested on Windows 7. I now use CryptPad to edit everything where I would have used Notepad. I recorded the registry changes with the "Default Programs Editor" freeware download, which works great. It is highly recommended.

The CryptPadAdd.REG file contains registry entries to associate the CryptPad program as the default editor for the .SAFE, .TXT, .HTML, .CMD, and .REG file types (extensions). There is a CryptPadDelete.REG file, which contains delete codes for these registry entries. The CryptPadInstall.CMD file automatically copies the CryptPad program to the default "install" location, edits in the default user profile location, and runs Regedit. The Install CMD script can also be run from the "install" directory to only add registry entries.

The "Program Files" directory can be used for an administrator install for all operators. This is supported by the provided "install" scripts. When the program is installed in the "Program Files" directory in a secure environment, it does not need special permissions. There is never an attempt made to write to the directory where the program is installed during normal operation of the program. The CryptPadInstallAdmin.REG, CryptPadAddAdmin.REG, and CryptPadDeleteAdmin.REG files support administrator install and modification of the registry for all users.

The administrator install option has not been well tested because I rarely use administrator permissions. The individual operator install has been heavily used and tested.

I provide the complete source so you can know for certain exactly what the CryptPad program does. Compile it for yourself, if you want. Examining the code is not easy, unless you are already a C# programmer, but it is available, if it is a concern to you. By these methods, you can trust the software. There is so much out there that is not trustworthy. You don't have to trust me. Full disclosure is the best trust there is.

The CryptPad program is a C# Windows Forms application compiled in VS2010 Express with the .NET framework version 3.5, which is included automatically with the Windows 7 OS. The program has only been well used and thoroughly tested with the Windows 7 OS.

The CryptPad program has only been used a little with the Windows 8 OS (Yuck!). Maybe Windows 8.1 will be better...

The CryptPad program has not been used or tested with Windows Vista (another Yuck!) or XP. Unfortunately, the .NET framework version 3.5 is not installed in Windows Vista or XP so you will need to install it to use the program in Windows Vista or XP. There are likely to be issues with the program on these operating systems. I don't use Windows Vista or XP anymore so I won't be able to help you.

Using the Program

Perhaps it will be helpful for me to describe a step by step procedure for creating an encrypted file.
  1. Start the CryptPad program.
  2. Select File, Encryption
  3. Enter your encryption string and type the Enter key.
  4. Enter the same encryption string again and type the Enter key.
  5. Enter your data.
  6. Save your file.
  7. If you open the encrypted file in Notepad you will see "~!@#" and more nonsense characters. Close the file without making any changes.
  8. Open the encrypted file in CryptPad.
  9. Enter your encryption string and type the Enter key.
  10. There is your data...

You may also add CryptPad encryption to an existing text file.

  1. Open any text file with the CryptPad program.
  2. Select File, Encryption
  3. Enter your encryption string and type the Enter key.
  4. Enter the same encryption string again and type the Enter key.
  5. Save your file.

It is also simple to remove CryptPad encryption from an existing encrypted text file.

  1. Open any encrypted text file with the CryptPad program.
  2. Enter your encryption string and type the Enter key.
  3. Select File, Encryption
  4. Enter a blank string
  5. Enter a second blank string
  6. Save your file.

The installation and use of the CryptPad program is NOT designed for the casual or novice operator! If you follow the instructions carefully, you will be able to install and use the program. The CryptPad program is as simple to use as Notepad. The minimum copy installation is very simple. Using "Open with" is not very hard either.

The readable CryptPadInstall.CMD and CryptPadAdd.REG files are also available to make a complete "install" of the CryptPad program. These have been carefully tested on the Windows 7 operating system.

Warning! The optional use of the CryptPadInstall.CMD and CryptPadAdd.REG files requires a high level of knowledge and sophisticated skill to understand the changes they make. You can do significant damage to the function of the Windows operating system using a .REG file which is just like using the Registry Editor. All the warnings you have seen about the dangers of the use of the Registry Editor apply to using a .REG file. You are usually safe using a prewritten .REG file created by a knowledgeable developer. You are usually safe when you carefully follow instructions created by a knowledgeable developer.

You are invited to go the Code Project (www.codeproject.com) forum where the CryptPad program is published to leave comments. Registration is required. Code Project is a gathering place for millions of software developers.

Using the Code

I am providing the complete VS2010 C# project zip file with the executable, documentation, and the complete source code for CryptPad, the encrypting editor Notepad replacement program for those who enjoy software code. You might be interested in adding your own special functionality.

I hope you find the source code instructive for picking up some ideas. I have learned a lot by examining the code of others. I hope examining my code will be useful to you.

The project contains numerous test files and various things I found useful to develop, test, and use CryptPad. Of particular interest are the "CryptPad (read-only)" and the "SendTo" shortcuts. Clicking the "SendTo" shortcut opens the directory where these shortcuts reside. You can drag and drop the "CryptPad (read-only)" shortcut on the "SendTo" shortcut to add a new item. There are many interesting and useful things you can do with the "SendTo" directory.

It is also particularly important to mention the CryptPadAdd.REG file. This file contains registry entries to provide the Windows Explorer, context menu, "Open With", type of associations to use CryptPad with various file extensions. You must edit the CryptPad.REG file to provide the location where the CryptPad.exe file is kept. You may also use the supplied CryptPadInstall.cmd file to automatically edit the file and apply the changes. Some of the entries provided by the CryptPadAdd.REG file cannot be duplicated by using only the "Open With" association functionality.

Warning! The use of a .REG file requires a high level of knowledge and sophistication. You can do significant damage to the function of the Windows operating system using a .REG file which is just like using the Registry Editor. All the warnings you have seen about the use of the Registry Editor apply to using a .REG file.

Points of Interest

One of the many interesting features in the CryptPad program source code is the automatic detection of ANSI, UTF-8, and Unicode character encodings with Byte Order Mark (BOM) detection. This is the feature missing out of all Notepad "clones" I have seen. One of them implements it now because I told the writer how to do it. The .NET library provides all the support needed for automatic detection but doesn't tell you how to use it.

There are two pieces of information required and some sample code to demonstrate their use. I have seen many complicated solutions proposed for automatic detection but it is actually quite simple. I will mention that my assumption is that the file is properly encoded without encoding errors or malformed characters. This is a reasonable assumption for any properly written program (such as Notepad and CryptPad) used to create a file.

The first piece of necessary information is to recognize that the UTF-8 encoding has been carefully designed for automatic detection, which makes it vastly different than the complexities and ambiguities of ANSI encoding. It is highly unlikely (but possible) that an ANSI file would be mistaken as UTF-8. The other detection methods don't promise any better. I won't go into detail about this feature of the UTF-8 encoding.

The second piece of necessary information is to recognize that the .NET library implements automatic detection through exception handling when ANSI characters are found. Unfortunately, the documentation doesn't connect the dots for how to implement this automatic detection.

This sample code illustrates automatic detection of UTF-8 and other Unicode encodings with an exception handling fallback to ANSI encoding.

This simple (assuming you are a competent C# programmer) example excerpt is not identical to the supplied source code.

file_stream = new FileStream (filename, FileMode.Open,
    FileAccess.ReadWrite, FileShare.Read);

// UTF-8 encoding with automatic dection of other
// Unicode encodings and ANSI error detection
Encoding save_encoding = new UTF8Encoding (false,true);
StreamReader sr = new StreamReader (file_stream,
    save_encoding, true);

string str = null;
try
{
    str = sr.ReadToEnd ();
    // Save the actual encoding for later write
    save_encoding = sr.CurrentEncoding;
}
catch
{
    // ANSI error detection
    save_encoding = null;
}
if (null == save_encoding)
{
    // use ANSI from the default code page
    save_encoding = Encoding.GetEncoding (0);
    file_stream.Position = 0;
    sr = new StreamReader (file_stream, save_encoding);
    str = sr.ReadToEnd ();
}

... modify str

// discard any previous contents
file_stream.SetLength (0);

// use StreamWriter with the same encoding
StreamWriter sw = new StreamWriter (file_stream,
    save_encoding);
sw.Write (str);

The most novel aspect of the CryptPad program source code is the encryption. The program uses a quick and simple scrambling algorithm of addition/subtraction based on a secret encryption string provided by the operator. The program encrypts only ASCII so that I have a contiguous arithmetic range. My apologies to those whose language is not based on ASCII. The intent is to continue to use text rather than binary processing. The encryption is highly efficient and adds only 21 bytes to the size.

These simple example excerpts are not identical to the supplied source code.

private string Encrypt (string str)
{
    StringBuilder st = new StringBuilder (str);
    for (int i = 0; i < st.Length; ++i)
    {
        int chr = st[i];
        if (isASCII ((char) chr))
        {
            chr = ' ' + (((chr - ' ') + E (i)) % 95);
            st[i] = (char) chr;
        }
    }
    return st.ToString ();
}

private string Decrypt (string str)
{
    StringBuilder st = new StringBuilder (str);
    for (int i = 0; i < st.Length; ++i)
    {
        int chr = st[i];
        if (isASCII ((char) chr))
        {
            chr = ' ' + ((chr - ' ') - E (i) + 95) % 95;
            st[i] = (char) chr;
        }
    }
    return st.ToString ();
}

The encryption string is scrambled with a pseudo-random number seeded with a checksum of the encryption string

private int E (int i)
{
return (encryption_string[i % encryption_string.Length]
    + i + i * random_seed) % 95;
}

// plus checksum for random_seed
private int ChecksumAdd (string str)
{
    int checksum = 0;
    for (int i = 0; i < str.Length; ++i)
    {
        checksum += str[i];
    }
    return checksum;
}

The CryptPad program uses an additional XOR checksum placed in the file to verify whether the encryption string is correct when attempting to decrypt. I protect short encryption strings by extending it to at least 32 characters. The purpose is to protect the operator from a wrong decryption and warn them, if they mistype the encryption string.

// xor checksum for in the file
private uint ChecksumXOR (string str)
{
    uint checksum = 0;
    int j = 32;
    if (32 < str.Length)
        j = str.Length;
    for (int i = 0; i < j; ++i)
    {
        uint t = 0;
        if (0 < (0x80000000 & checksum))
            t = 1;
        checksum <<= 1;
        checksum |= t;
        checksum ^= str[i % str.Length];
    }
    return checksum;
}

I use a second XOR checksum to detect whether the encrypted data has been corrupted by being modified without being decrypted. This would destroy the integrity of the encrypted data. The operator would be notified immediately upon attempting to open the file whether the encrypted data had been modified and corrupted. If the '~!@#$' encryption header is modified, then the data is assumed to be non-encrypted and displayed without decryption.

I would not claim the encryption used by the CryptPad program is CIA quality but I think you will find it is highly effective. The strength of the encryption is highly dependent on the length of the encryption string. A strong string of ten characters or more is not likely to be broken by anyone except a skilled cryptologist. I am not a skilled cryptologist but I am familiar with some aspects of cryptology. The primary attacks against this encryption have been anticipated.

I am offering a challenge to see if a clever hacker or skilled cryptologist will take an interest and break my encryption. I have included a file called "hack.safe" in the zip file. If you can break my encryption, please post the results in the discussion with the encryption string. Anyone can verify your success. I would be interested to know how you did it, how long it took, and what type of equipment was needed.

The most likely attack would be against the XOR checksum used to verify the encryption string against typographical error. The success of this type of attack depends on the strength of the encryption string you choose.

The suggestion has been made that I should use the File.Encrypt method. I do not want a decrypted version of the file to ever reside on any drive for any period of time. I want to be able to carry the file anywhere I want and use anywhere I want. CryptPad.exe can be carried with the encrypted file (such as on a USB drive) and used anywhere to read the file without any installation or removal and there is never a trace of the decrypted file on the computer (Well, maybe in memory or in the paging file...). I want the encryption to be text that I can copy and paste anywhere. The File.Encrypt method does not meet any of those criteria. I have seen nothing that meets these criteria.

What Is Notepad?

Notepad is the basic text editing tool provided by the Windows operating system to view or edit plain text files. A text file is a file type typically identified by the .TXT file name extension. There are other extensions which contain text, which I often edit with Notepad.

Notepad has several specific important characteristics to note beside the fact it is a plain text editor. Probably the next most important characteristic of Notepad is that the entire file is completely loaded into memory while editing. This makes Notepad fast for the typical file of about 64k or less. However this is a problem when editing multi-megabyte files. The good news is that Windows 7 Notepad and CryptPad can do it but the bad news is that it slows down pretty quickly. You usually don't need to do this very often.

Another important characteristic is that it supports all the standard file encodings. ANSI, UTF-8 (ASCII), Unicode (UTF-8), Unicode, and Unicode (Big-Endian).

What Is Windows Explorer?

It is important to understand that Notepad is tightly integrated with Windows Explorer. The CryptPad program can also be tightly integrated with Windows Explorer. Windows Explorer is my primary development platform or environment for general purposes. Most developers understand this. A beginning computer operator may not understand the importance of Windows Explorer, which is also known as "My Computer". Many people use the "Desktop" as their primary launch platform. The "Desktop" is actually a simple view of Windows Explorer. I primarily use Windows Explorer as my launch platform.

The first thing I always do on a new computer is enable the icon for "My Computer" on the "Desktop". I also always rename it to the name of the computer because I remote to so many computers so often, it helps to have a little reminder of what computer I am using. Many times the first thing I click on the desktop is "My Computer" or Windows Explorer.

I am very particular about how Windows Explorer is configured. It is vitally important that all file information be displayed. The second thing I always do on a new computer is enable file details in Windows Explorer. The third thing I do is change the default Layout to show the Navigation pane. I also like the Details pane.

What Is Plain Text?

All files can be placed in two general categories. Text files are designed primarily to be read by a person. Binary files are designed primarily to be read by a computer program. Binary files may contain text but text files almost never contain binary data.

A proper plain text file contains only printing characters designed to be read by a person. The file will contain the ASCII CR/LF control characters to indicate the end of a line and the ASCII HT (TAB) control characters to arrange text in columns. Any other ASCII control characters are improper. Some of the ASCII control characters are actually encoded to a printable Unicode character. It is also improper in a typical Windows file for there to be ASCII CR or LF control characters which are not part of a CR/LF pair.

What Is the TextBox?

Notepad is based on the Windows TextBox control which provides most of the editing functionality. Notepad and TextBox are both a bit short on documentation for their functionality but are mostly simple. The Help option in Notepad does little more than provide answers to some common simple questions about Notepad.

TextBox is the primary input control for Windows. Almost all other Windows input functionality either expands or imitates the basic functionality of TextBox.

How is CryptPad different?

The basic use of CryptPad is almost identical to Notepad. The design of the CryptPad program is similar to Notepad. CryptPad is also based on the TextBox control. The primary difference of CryptPad from Notepad is a lack of support for printing. CryptPad adds support for encryption, file locking, and automatic backup. CryptPad provides other functionality beyond Notepad.

The most useful functionality for developers is the error checking for misplaced control characters and other checking and correcting functions. CryptPad is also more helpful and functional than Notepad without loosing the basic simplicity and speed.

Release History and Notes

A history of changes to the CryptPad program and release notes.
  • Version 2.3 released 2013-10-06:
    • Corrected index error on SaveAs when manually selecting encrypted.
    • Corrected Goto to scroll to the new line.
    • Changed all use of the Scrolltocaret TextBox functions to scroll to a few lines below the caret.
    • Improved centering of Find/Replace dialog when current selection is also in the center.
    • Improved the installation options of CryptPad to support an administrator install in the "Program Files" directory.
    • Changed read-only mode to close the file after reading and disable all changes, which cannot be saved anyway.
    • Added the ability to change the font color and the background color of the TextBox editing window.
    • Added CryptPad23 directory to Help and the website preserving the old version directory.
  • Version 2.2 released 2013-09-21:
    • Allowed ESC key to cancel the new messagebox form and the Help, About form.
    • Refuse to edit a file with a backup extension.
    • Corrected a problem where settings were not saved if you did not move the window from its default startup position.
    • Corrected a problem where backup could not be disabled.
    • Added CryptPad22 directory to Help and the website preserving the old version directory.
  • Version 2.1 released 2013-08-04:
    • Allowed the filename for DO ANSI and DO UTF-8 to be optional in a command script where there is already an open file.
    • Save As defaults to the file extension .SAFE for encrypted text files and .TXT for all other text files.
    • I learned how to use the operator specified Message Box system font throughout CryptPad rather than specifying Verdana 12pt. Those with young good eyes can use the default 9pt or whatever while those with older poor eyes can use what we need. This works fine on Windows 7 but Microsoft in their great wisdom does not appear to allow us to specify our own font on Windows 8! Changing the font size on Windows 8 is also awkward, as is much of Windows 8. (Did I already say? Yuck!) Who do I complain to that will listen and do something for the handicapped?
    • CryptPad recognizes non-printing ASCII/ANSI control characters in the "FIND ANSI Blanks" function and warns if they are found on "Open".
    • Removed Direction radio buttons from the Find dialog in favor of the "Find Previous" button.
    • Added CryptPad21 directory to Help and the website preserving the old version directory.
    • Added readable example installation and removal files.
  • Version 2.0 released 2013-07-07:
    • Revised and continued adding Command Line Automation functions.
    • Added a Command Line function to display the command line arguments provided at program startup. This is useful in debugging Command Line Automation functions.
    • Added a second XOR checksum to detect and warn whether the encrypted data has been improperly modified or corrupted. If you have used CryptPad to make important encrypted files in an earlier version, you need to be aware there is an automatic file conversion which makes a version 2 encrypted file incompatible with earlier versions. If you need to know, you can remove character 5 ('$') and 6-13 (hexadecimal checksum) to restore version 1 compatibility.
    • Replaced MessageBox, which centers on the screen instead of the parent window, for all popup message functions. All popup messages will now appear in the center of the CryptPad window. This was implemented as a simple single file class, which can be easily used in other programs.
    • I changed the meaning of Find Next (F3) to always use direction down and added a Find Previous (Shift-F3) to use direction up. I am familiar with these assignments from other programs. I hope it is not a problem for others.
    • Added the Automatic Backup option.
  • Version 1.11 released 2013-06-16:
    • Adding Command Line Automation functions.
    • Added an option to force UTF-8 (ASCII) encoding before the file is written.
    • Changed "Company" reference from Keep It Simple Software to Frank T Clark Software because there is already a registered company by that name. Settings are tied to the company name so the previous settings are lost. They may be retrieved by copying the user.config file from the C:\Users\%username%\AppData\Local\Keep_It_Simple_Software\... directory but this is not obvious or simple.
    • Changed "Copyright" reference to a Published/Revised date.
    • Fixed initialization on Windows Position to allow the settings to be remembered.
    • Improved dangling CR or LF detection.
    • Fixed error with Cancel of Save not returning to document modifications as it should. I lost some work! (Heavy sigh...)
  • Version 1.10 released 2013-05-14:
    • Problem with settings being saved too often leading to a conflict when two files opened at the same time.
    • Caret moved to the top after Replace All.
    • A warning is given on file open if a dangling CR or LF is seen outside of a CR/LF pair.
    • Added "Force CR/LF (Windows)", "Force LF (UNIX)", and "Mark dangling CR or LF" to the Tools menu.
    • Fixed unescape of backslash sequences for Find and Replace.
    • I discovered Notepad changes NUL characters to spaces or the textbox will not work!
  • Version 1.9 released 2013-04-18:
    • Major code review and revise.
    • Improved graphics and icon modified from Notepad.
    • Fixed find direction up.
    • Fixed some missing Verdana 12pt settings.
    • Discard previous file completely at Open of a new file.
    • Replace All was too slow and would not undo all so changed to match Notepad.
    • Improved all Undo function to match Notepad.
  • Version 1.8.0.0 released 2013-04-10:
    • Improved layout of popup windows to center and to avoid going off the edge of the screen.
    • Fixed find and replace non-modal dialogs to not conflict or duplicate and other action changes.
    • I also made the find and replace dialogs smaller again but sizable.
  • Version 1.7.0.0 released 2013-04-05:
    • Window Position does not remember maximized or minimized.
    • Moved some new functions to a new Tools menu.
    • Added a search to find non-ASCII characters.
    • Added a search for the longest line.
    • Do not allow changes to a file opened read-only.
  • Version 1.6.0.0 released 2013-03-31:
    • Added Preference Setting persistence for the current directory.
    • Added version upgrade for Preference Settings.
    • Adjusted the handling of file encoding on save to use Unicode BOM where specified or appropriate.
    • Added an option to force ANSI encoding before the file is written.
    • The Status Bar shows the current file encoding.
    • The visibility of display items on the Status Bar can be individually selected.
    • The CryptPad program will still warn and require confirmation for a file over about 2MB but will allow any file size no matter how slow it becomes.
    • Set the textbox MaxLength to 0, use all available memory, which allows the CryptPad program to crawl and/or crash, if the operator specifies a file which is just too big.
    • Fixed the problem with a creeping Window Position.
  • Version 1.5.0.1 released 2013-03-27:
    • Corrected an exception which occurred when a blank encryption string is entered.
    • Improved the wording of the prompt requesting the encryption string.
    • Expanded the information displayed on the status line.
  • Version 1.5.0.0 released 2013-03-25:
    • Added a subset of C-type escape character processing to the find and replace functions for some common characters.
      • \n New line
      • \r Carriage return
      • \t Horizontal tab
      • \\ Backslash
      I also made the find and replace input textboxes wider. The Paste, Copy, and Cut functions support the new escape characters.
    • I modified the XOR algorithm to recognize encryption strings longer than 32 characters and be more accurate as a checksum to identify typos in the encryption string.

      If you have used CryptPad to make important encrypted files in an earlier version, you will need to convert the encrypted file because the version 1.5 and later file header is incompatible with version 1.4 and earlier encryption.

      The typical conversion process requires you to do a "Select All" to copy and paste the plaintext of existing encrypted files directly from the open window of the version 1.4 or earlier program to the version 1.5 or later program and save with the new encryption.

  • Version 1.4.0.0 released 2013-03-22:
    • Added View, Status Bar.
    • Added Preference Setting persistence for Word Wrap, Font, Window Position, and Status Bar.
    • Removed many unnecessary files from the ZIP file reducing the size from about 2MB to about 138 KB.
  • Version 1.3.0.0 released 2013-03-17:
    • Handle ANSI, UNICODE, and UTF-8 files. Provides conversions.
  • Version 1.2.0.0 released 2013-03-15:
    • Changed the program icon from a generic icon to a simple custom design.
    • Added the "Edit" option "Transpose" to switch the character to the left and right of the cursor. I don't know how often you have a problem with transposing characters as you type but it happens to me a lot.
    • Added registry file to automatically use CryptPad for selected file types.
  • Version 1.1.0.0 released 2013-03-08:
    • Added the QuickCrypt function.
    • Required the encryption string to be at least four characters. Strengthened the checksum and encryption header. Corrected loss of the '~' character. Scrambled the encryption string. Incompatible with version 1.0 encryption. You must copy and paste the plaintext of existing encrypted files from the version 1.0 program to the version 1.1 program and save with new encryption.
    • Corrected some confusion with the initial directory on a Save As after a command line open.
    • Finished the Replace function, corrected dialog inconsistencies, and improved Notepad similarity.
    • Changed Edit menu option "Capital&ize" to Initial Capital.
    • Increased the textbox MaxLength from 32KB to 15MB. Generate an error and fail the open if the file size is greater than 10MB. Generate a warning if the size is greater than 5MB.
  • Version 1.0.0.0 released 2013-03-01:
    • These are the new and changed features compared to Notepad.
    • Only ASCII is supported in the encryption functions. Non-ASCII characters will not be encrypted. The initial encryption algorithm is not particularly sophisticated but it is completely effective to block the curious and prying. This is not intended to be a high security solution!
    • Automatic random password generation for websites. The sophisticated password would be stored in the encrypted file so you don't have to remember it. A typical line or sequence of lines in the file would have the website address, the email address/username, and the password for a quick and simple copy and paste to login.
    • The file is held open to reduce accidental multiple change problems. Read share only. Therefore, a read-only option is allowed on open.
    • The secondary purpose is to provide some enhanced functionality for general file editing:
    • Uppercase, lowercase, capitalize selection conversion.
    • Word wrap toggle remembers cursor location. Unlike Notepad it does not jump you to the beginning of the document.
    • Replace All leaves the last changed selection highlighted instead of jump to the beginning.
    • Go To works with word wrap on though the meaning is changed to wrapped line numbers.
    • The default directory for "Open" and "Save as" is initially the documents directory and becomes the directory of the last opened or saved file in the current session.
    • The Verdana font at 12 point is used in all program controls. This provides higher visibility for easier readability.

Command Line Automation

The CryptPad program supports Command Line Automation. Commands may be placed on a command line call to automate certain editor functions.

A single command line argument is typically a file name to edit. This allows a file to be selected for editing from the command line. A command line call is how "Open With" is supported.

There is a special mode of operation for files with an extension of .CryptPad such as "script.CryptPad". These are read as SCRIPT files for command line automation. An optional second command line argument specifies a file to edit using the script automation. This allows the same script to be used on multiple files without editing in the file name.

CryptPad supports only one document file being specified on the command line for editing or with a script. If there is more than one command line argument (or two with a .CryptPad script file as the first argument), then the first argument must be "DO". Uppercase is not required for any automation argument. The second argument specifies the function to perform. Additional arguments specify additional information for the specific automation function to perform. The program exits immediately after most automation functions are performed. The file will be saved, if it has actually been changed.

Example command lines assuming .SAFE and .CryptPad are identified in the registry for "Open With":

file.safe
script.CryptPad
script.CryptPad file.safe

Example script.CryptPad file:

do replace "first value" "first string"
do replace "second value" "second string"

The standard "Open With" association does not allow an argument for the .CryptPad file. The file provided in the CryptPad project contains the proper registry entries.

CryptPad will return an errorlevel of 0 for a successfully edited file. A value of 1 indicates that no file was saved or changed. An errorlevel of 2 indicates a command line error. Command line errors will also display an error and halt execution until the error is acknowledged. A command line or automation script error will abort saving any changes to the current file.

The following is an example Windows 7 tested CMD script which changes all files in the current directory to UTF-8 assuming the CryptPad program is in a CryptPad subdirectory of the Document directory. The CMD script displays a count of the files found and actually changed:

@echo off
rem
rem CryptPadx.cmd - Automation test
rem

set p=%userprofile%\Documents\CryptPad\CryptPad.exe
set /a total=0
set /a count=0

for %%f in (atest*.txt) do call :change %%f

echo Total: %total% Changed: %count%
pause

goto :EOF

:change

echo Checking %1

set /a total=total+1

%p% do utf-8 %1

echo Change error %errorlevel%

if not errorlevel 1 goto :EOF

set /a count=count+1

goto :EOF

This is an alternate example that depends on the .CryptPad association provided by the file. This method does not need to know the location of the CryptPad.exe file because it is embeddded in the registry.

@echo off
rem
rem CryptPadx.cmd - Automation test
rem

echo do utf-8 >script.CryptPad

set /a total=0
set /a count=0

for %%f in (atest*.txt) do call :change %%f

echo Total: %total% Changed: %count%
pause

goto :EOF

:change

echo Checking %1

set /a total=total+1

script.CryptPad %1

echo Change error %errorlevel%

if not errorlevel 1 goto :EOF

set /a count=count+1

goto :EOF

There is a Command Line function from the menu of the CryptPad program to display the command line arguments provided at program startup. This is useful in debugging Command Line Automation functions.

DO SCRIPT filename

Read automation script commands from a (non-ANSI!) file. This is primarily useful to allow multiple automated replace commands. All automation script commands in the file begin with "DO". The SCRIPT command may not be used (nested) in an automation script. This command may only be used directly from the command line. It is easier to use a special "Open With" association for the .CryptPad extension as illustrated in the file.

Example script file:

do edit test.txt
do replace "first value" "first string"
do replace "second value" "second string"

Any error will abort the automation script and return errorlevel 2.

DO ANSI [filename]

Open the specified filename or use the existing open file. Perform the Force ANSI function. If the encoding is already ANSI, the file and its modification date will not be changed. When given as a command line, save the file, and exit. Otherwise, leave open for additional automation script processing.

Remember that a file with only ASCII characters is "UTF-8 (ASCII)" encoded. It will be saved and its modification date will be changed but the file contents will not be changed.

DO UTF-8 [filename]

Open the specified filename or use the existing open file. Perform the Force UTF-8 (ASCII) function. If the encoding is already UTF-8 (ASCII), the file and its modification date will not be changed. When given as a command line, save the file, and exit. Otherwise, leave open for additional automation script processing.

Remember that a file with only ASCII characters is already "UTF-8 (ASCII)" encoded.

DO READONLY file

Open the specified file read-only but do not exit and allow viewing. This allows editing read-only from the Windows Explorer context menu. The registry example file illustrates how to implement this function. This function is designed only for the command line and will abort an automation script.

DO EDIT file

Open the specified file. Any previously opened file will be closed and saved. This command is intended primarily for use in an automation script but will also open a file from the command line. This is the only way to open a .CryptPad file for editing from the command line. A .CryptPad file can also be opened for editing using the File, Open menu option from within the CryptPad program.

DO REPLACE search-string replace-string

This command performs an automated string replace all (ignore case) function in the currently opened file. This command is only for use in an automation script.

Example:

DO EDIT test.txt
DO REPLACE "testing" "implemented"

When a quote is part of the string it is preceded with a backslash. This function supports a subset of C-type escape character processing as described in the Find function.

DO REPLACEMATCH search-string replace-string

This command is similar to DO REPLACE but performs an automated string replace all (match case) function in the currently opened file. This command is only for use in an automation script.

Menu bar

The menu bar contains the menu groupings for all the functions performed by the CryptPad program.

File Menu

The file menu contains the typical functions for handling file operations, encoding, encryption, and exiting the program.

New

A new blank and untitled document is created with this option.

If the current document has been modified, you will be offered the option to save the document.

When the window is closed, if you have made any changes, you will be offered the option to save the document to a file.

The new document will be unencrypted. You can immediately set an encryption string to encrypt the document when it is saved. You may refer to the section on Encryption for additional details.

The default encoding for the new document will be UTF-8 (ASCII). You may refer to the section on Encoding for additional details.

Open

Open an existing file for editing.

If the current document has been modified, you will be offered the option to save the document. Unlike Notepad, the document is closed immediately unless you cancel the option to save. You will not return to the document, if you cancel the Open. The encryption string of the current document is preserved for possible use in the document being opened.

A dialog is displayed to specify a document file to open. If the file is encrypted with an encryption string different from the current encryption string, the encryption string will be requested. If the file is not encrypted, the current encryption string is erased.

You may refer to the section on Encryption for additional details.

Unlike Notepad, CryptPad maintains the file in an opened state locked against parallel changes but shared with file readers. This protects the file against accidental parallel modification data loss problems. I have had this happen to me on occasion with Notepad. You can still lose data but it will have to be by deliberate actions and not by a simple accident.

CryptPad offers to attempt to open a file read-only when any file error occurs on open. You may also specify opening read-only with the file type selection on the file open dialog. A read-only file cannot be modified and saved to protect against accidental parallel modification data loss problems. CryptPad will not ever save the file unless you use the "Save As" command..

The CryptPad program displays a warning if the file is greater than about 2MB and requires confirmation to open. The reason for the warning is that it will be very slow to edit a file greater than such a large size. Truly large files may crash the program because it reads the entire file into memory.

The CryptPad program displays a warning if a dangling CR or LF is seen outside of a CR/LF pair with a recommendation to force CR/LF.

The CryptPad program displays a warning if there are other non-printing ASCII/ANSI control characters (ANSI Blanks) found in the file. This also usually indicates a binary file that you really should not edit.

CryptPad automatically detects the default ANSI code page, UTF-8, and Unicode file encodings on open. The program assumes UTF-8 encoding unless ANSI characters are detected, which UTF-8 does not read properly. It is unlikely (but possible) ANSI characters will be mistaken as UTF-8. UTF-8 without the Byte Order Mark (BOM) is identical to ASCII unless there are ANSI or Unicode characters.

You may refer to the section on Encoding for additional details.

The CryptPad program displays a warning if NUL characters are found in the file because these must be changed to space characters for the TextBox to work. This usually indicates a binary file that you really should not edit.

Just like Notepad, a space will be substituted for any NUL characters in the file. This is required for the textbox function. This change will not be noted as a file change to trigger a save reminder but will be included if the file is saved. This change will corrupt any binary file you may happen to save after viewing with CryptPad.

CryptPad will refuse to open a file with a backup extension of 1, 2, or 3.

Save

The current document is saved. If there is a current encryption string, the file is encrypted.

You may refer to the section on Encryption for additional details.

CryptPad uses the original file encoding when saving the file as used when the file was opened or last saved. The file contains a BOM for Unicode. UTF-8 only contains a BOM, if one was originally specified.

You may refer to the section on Encoding for additional details.

The file remains open for continued editing. You must select the "NEW" option to close the file.

Save As

A dialog is displayed to specify a document file name to save the current document. If there is a current encryption string, the file is encrypted. The default file extension is .SAFE for encrypted text files and .TXT for all other text files.

You may refer to the section on Encryption for additional details.

CryptPad defaults to the original file encoding when saving the file. The "Save as type:" option can be used to select alternate file encodings.

You may refer to the section on Encoding for additional details.

The file remains open for continued editing. You must select the "NEW" option to close the file.

Force ANSI

Use this function to force ASCII/ANSI encoding for the current open file, if you must be certain to force ASCII/ANSI encoding when the file is written. This does not change any text currently being edited. CryptPad does not force only ASCII/ANSI text to be entered but an error will occur when the file is saved, if the text contains any Unicode characters which cannot be mapped into the current code page.

Force UTF-8 (ASCII)

Use this function to force "UTF-8 (ASCII)" encoding for the current open file, if you must be certain to force "UTF-8 (ASCII)" encoding when the file is written. This does not change any text currently being edited.

Remember that a file with only ASCII characters is already "UTF-8 (ASCII)" encoded.

You may refer to the section on Encoding for additional details.

Encryption

A dialog is displayed to add, change, or remove the encryption string. The encryption string must be at least 4 ASCII characters. Longer is better. There is no particular maximum limit. About 32 characters is an ideal choice. Only ASCII characters are allowed in the encryption string.

Warning! You will not be able to decrypt the contents of this file, unless you remember this encryption string. If you forget this encryption string, you will not ever be able to retrieve the encryption string. There is absolutely NO back door. Once you click the Ok button, you cannot remove or change the encryption string, unless you remember this string and enter it again.

You will be required to enter a new encryption string twice to verify its contents. This is necessary because you will not be able to see the contents of the encryption string as you type it. If you type the same thing twice, it is assumed there was no error and you will remember the encryption string. Make it something you will certainly remember. Since this is so highly critical, there are no particular requirements for the encryption string contents.

Only ASCII is supported in the encryption functions. Non-ASCII characters will not be encrypted. My apologies to those whose language is not based on ASCII. The encryption algorithm is not particularly sophisticated but it is completely effective to block the curious and prying. This is not intended to be a CIA high security solution!

Almost nobody will be able to break an encryption string of even a single word. A highly safe and effective encryption string is a short sentence or phrase containing at least three words. Using silly words not found in the dictionary is very effective. Remember! You must not forget the encryption string or you will not ever be able to decrypt your hidden data.

See QuickCrypt for additional information about encrypted data.

Exit

This option exits the program.

If the current document has been modified, you will be offered the option to save the document.

Edit Menu

The Edit Menu selection contains functions for special editing of the document.

Undo

Undo the latest editing operation, if an undo is supported for the last operation. Any text you enter can be undone, restoring any optional selected text you replaced, until you use the arrow keys or the mouse to move the caret and enter new text. Only one Undo is supported by the TextBox control. A second Undo will restore the original data.

Cut

Copy the currently selected text to the system clipboard and delete it from the document. If there is no selected text, the system clipboard and the document will be unchanged. You can Undo this operation but the system clipboard continues to retain a copy of the Cut text.

The text remains in the system clipboard no matter how many times you Paste until the next Cut or Copy. The system clipboard is not ever cleared, even when the CryptPad program exits.

Copy

Copy the currently selected text to the system clipboard. If there is no selected text, the system clipboard will be unchanged.

The text remains in the system clipboard no matter how many times you Paste until the next Cut or Copy. The system clipboard is not ever cleared, even when the CryptPad program exits.

Paste

Paste the system clipboard text to the document. This will replace any current selection. You can Undo this operation.

The text remains in the system clipboard no matter how many times you Paste until the next Cut or Copy. The system clipboard is not even cleared when the CryptPad program exits.

Delete

Delete the currently selected text. If no text is selected, the character after the caret (cursor) position is deleted. You can Undo this operation.

Uppercase

Convert the currently selected text to uppercase. You can Undo this operation.

Lowercase

Convert the currently selected text to lowercase. You can Undo this operation.

Initial Capital

Convert the currently selected text to initial capital on the words preceded by a space. The first character of the selection is assumed to start a word. You may Double-Click on a word and type the shortcut Ctrl-I. You can Undo this operation.

Transpose

The "Transpose" function switches the character to the left and right of the cursor. I don't know how often you have a problem with transposing characters as you type but it happens to me a lot. You can Undo this operation.

This function will do nothing if there is currently selected text. Nothing is done when the caret is at the beginning or end of a line. I only do the transpose for ASCII characters because of possible confusion about recognizing and parsing ANSI or Unicode characters.

Find

Display a dialog to specify a string to search.

This function supports a subset of C-type escape character processing for both find and replace functions for the ASCII control characters commonly found in text files.

  • \n New line
  • \r Carriage return
  • \t Horizontal tab
  • \\ Backslash

The context menu and shortcuts in both the find and replace input textboxes support the new escape characters for the Paste, Copy, and Cut functions. If you forget and place a single backslash in the textbox, it will be treated like a backslash, if it is not followed by one of the special characters. If you try to enter a search for two backslashes, it will be changed to one unless you enter four!

Find Next

Find the next string in the document. If no find string has been previously specified, the dialog will be displayed. Unlike Notepad, this function will always search down.

Find Previous

Find the previous string in the document. If no find string has been previously specified, the dialog will be displayed. This function will always search up.

Replace

Display a dialog to specify string search and replacement options.

The context menu and shortcuts in both the find and replace input textboxes support the new escape characters for the Paste, Copy, and Cut functions. The new escape characters are described in the Find function.

Go To

Displays the line number at the current cursor position and allows you to specify a new line to change the current cursor position. When Word Wrap is on the line number is of the wrapped lines, therefore it may not be the same line as when Word Wrap is off.

When you are entering a line number provided by a program, you will usually need to make sure that Word Wrap is off or you will go to the wrong line.

Select All

Select all the text in the document. The text is not copied to the clipboard until you specify a Copy.

Date/Time

Insert the date and the time in ISO 8601 standard universal date and time formats. The time includes milliseconds. The local time is used but the time zone is not indicated. These are separate date and time fields so they are separated with a space, as allowed by the standard. This is not to be confused with the standard format for combined date and time which is spearated by a "T" character.

Example:

2013-03-24 15:55:58.347

If there is currently selected text, it will be replaced. It is assumed the selected text is an old date and time value. You can Undo this operation.

Tools Menu

The Tools Menu contains some additional special options added by the CryptPad program.

Password

Insert an automatically generated random password into the document. The randomization selects 16 characters from uppercase/lowercase ASCII letters and numbers. This is particularly useful in an encrypted file for remembering unique, ultra-secret, highly secure passwords for websites. Do not use this as an encryption string! It will be impossible to remember.

Example:

EHbKLQZRRv53VN5K

If there is currently selected text, it will be replaced. It is assumed the selected text is an old password. You can Undo this operation.

When you use the random password generation for websites, the sophisticated password would be stored in an encrypted file so you don't have to remember it. A typical line or sequence of lines in the encrypted file would have the website address, the email address/username, and the password. This can be used for a quick and simple copy/paste of the website address, then copy/paste the login username, and finally copy/paste the password. Unfortunately, some difficult websites will not allow you to copy and paste the password.

QuickCrypt

Using the current encryption string, convert the plaintext to the encrypted text. If there is not an encryption string present, one will be requested. This function is particularly useful to copy and paste encrypted text to and from email or instant messages.

You can recognize encrypted text because it always begins with the encryption prefix "~!@#$". If the encrypted text is already shown, this command will convert the encrypted text to the plaintext.

The version 1 encryption prefix was "~!@#". If you need to know, just remove character 5 ('$') and 6-13 (hexadecimal checksum) to restore version 1 compatibility.

Warning! If you change anything else while the encrypted text is shown, you will not be able to decrypt the text.

The encryption prefix "~!@#$" must be the first characters in the text to reverse the encryption. Version 2 has an eight hexadecimal character checksum after the encryption prefix to verify the data has not been modified or corrupted. There is also another eight hexadecimal character checksum which verifies that the current encryption string actually applies to this text.

If any encryption text is changed, in any editor, you lose the ability to ever decrypt the text. Someone can destroy your encrypted data but they can never see it.

You may refer to the section on Encryption for additional details.

Find non-ASCII

Find and select the next non-ASCII character after the caret or current selection.

Find longest line

Find the longest line and place the caret at the end of the line. This function ignores Word Wrap.

Force CR/LF (Windows)

First remove all CR then make sure every LF is CR/LF. This is the normal condition for a data file used by the Windows operating systems. This is the normal editing condition.

Force LF (UNIX)

Remove all CR leaving only LF. This is the normal condition for a data file used by UNIX type operating systems. This is not a normal editing condition. This condition is usually only created before a close and save.

Mark dangling CR or LF

The first dangling CR or LF found in the file will be changed to the string "\r" or "\n" and selected.

Find ANSI Blank

The first non-printing ASCII/ANSI character found in the file will be changed to the string "\xnn" and selected. "nn" will be the hexadecimal value of the character. Values will always be "\x01", "\X1c", "\X1d", "\X1e", "\X1f", "\X81", "\X8d", "\X8f", "\X90", "\X9d", or "\Xa0". These values represent characters which do not display anything so they are invisible in the typical fonts. Some of these characters display as a space and some are zero width and do not display at all.

Command Line

Display the current directory and the command line arguments provided at program startup. This is particularly useful to understand the environment of Command Line Automation functions. CLA errors will automatically display this information.

Automatic Backup

This menu selection allow you to select options for automatic backup. You can select anything from zero to 3 backups. When a backup is performed file.ext is renamed to file.ext.1, file.ext.1 is renamed to file.ext.2, and so on for the number of backups selected.

Backup only occurs with the first save after open. I have the practice of editing HTML in a tiled window with Internet Explorer (IE) displaying the HTML. I save the file many times while editing and refresh the IE window to see the results. I do not want a backup for every intermediate save. If you want to force a backup while editing, then you will need to open the file again.

CryptPad will refuse to open a file with a backup extension of 1, 2, or 3.

Format Menu

These options change the format of how the text is displayed in the CryptPad TextBox.

Word Wrap

Toggle word wrap. A TextBox line longer than 1024 is always wrapped to a second display line breaking even in the middle of a word.

When Word Wrap is on, the TextBox lines will be wrapped at the width of the current window. The rules for automatic wrapping at a TextBox window are complicated. Generally, wrapping occurs after a space, question mark, exclamation mark, closing brace, closing parenthesis, vertical bar, and hypphen or before a dollar sign, percent sign, plus sign, and opening parenthesis.

Font

Display a dialog to select the font and color to use in displaying and editing the document. Lucida Console 12pt Black is the original setting.

Background Color

Displays a color dialog to pick a different background color for the TextBox during normal editing. White is the original setting.

View Menu

This menu allows you to select what information you wish to see in the Status Bar. If none of the items are selected, the Status Bar will not be shown. If the window is not wide enough for everything to display, then only the first items that fit will display.

Line/Char

Toggle the display in the Status Bar of the current line number and character position of the caret in the current line. This is not necessarily the same as the column number, if there are tabs in the line. The line number can be different depending on whether Word Wrap is on or not.

Before/After

Toggle the display in the Status Bar of the number of characters before the caret and the number of characters after the caret.

Lines/Chars

Toggle the display in the Status Bar of the total number of lines and the total number of characters in the file.

Beware! The current line number is for wrapped lines in Word Wrap mode but the total number of lines is still for real lines. Also note that the total number of characters includes the CR/LF characters and any other control characters in the text. The total number of characters will only match the file size for files with ANSI encoding or UTF-8, which contains only ASCII characters.

Encoding

Toggle the display in the Status Bar of the file encoding. Typical file encodings:
  • "Windows-1252"

    Also known as "ANSI", "ISO-8859-1", and "Western European (Windows)". This is typical for many computer systems. This encoding is for the local code page which can be different on your computer depending on how the computer system is configured. ANSI characters are always 8 bits.

    You will not normally see this encoding in CryptPad unless you are opening a file which contains ANSI characters or you have specified for a file to be saved with ANSI encoding.

  • "UTF-8 (ASCII)"

    This encoding does not use a Byte Order Mark (BOM) at the beginning of the file. This is the recommended encoding for all current files. UTF-8 characters use 8 bits but non-ASCII characters are always followed by additional 8 bit characters.

    CryptPad will normally open a file with this encoding. This encoding is completely appropriate for files containing only ASCII characters and will not cause a problem creating ASCII text for any program expecting ASCII characters. This encoding will also allow you to enter Unicode characters, which will cause problems for some older programs, which expect only ASCII or ANSI.

    UTF-8 characters can be mistaken for ANSI characters by an older program looking for ANSI characters. A person looking at the file contents in an editor can usually recognize immediately that the character patterns do not make sense. ANSI characters can not usually be mistaken for UTF-8 characters by a newer program looking for UTF-8 characters. UTF-8 characters follow a certain pattern.

  • "Unicode (UTF-8)"

    This is the same as UTF-8 (ASCII) encoding but it uses a BOM. This encoding is not appropriate for programs requiring ASCII files, even if the file contains only ASCII characters because the BOM writes non-ASCII characters to the beginning of the file. Most current programs and editors such as Notepad and CryptPad use this encoding with no problems but older programs may fail in mysterious ways.

  • "Unicode"

    Also known as "UTF-16". All characters in this encoding use 16 bits. This encoding is rarely used by files for Windows programs. It is important for programmers to note that most Windows programs use this format internally for all characters.

  • "Unicode (Big-Endian)"

    This encoding is normally only used on non-Windows computers.

Help Menu

The Help Menu contains options for viewing help and program information.

Online Contents

This option will open the web site "http://www.frank-t-clark.com/Professional/Papers/CryptPad23/CryptPad.html" which contains the online version of the documentation for the current version of the program.

This web page may be saved to the "CryptPad.html" file in the directory with the program. This updates the Local Contents. Links from the page may fail unless additional pages and images are copied to the directory from the website.

Local Contents

This option will open the local web file "CryptPad.html" which contains the local version of the documentation for the program. The file is expected to be in the same directory as the program file. Links from the page may fail unless additional pages and images are copied to the directory from the website.

This is useful for when you are not connected to the Internet. This help file and the minimum graphic file are included in the download zip file.

About

This option displays the program version number and other information.

Keyboard Shortcuts

This is an alphabetical list of the keyboard shortcuts using the function keys and the Ctrl key. The shortcuts marked with an asterisk "*" are also TextBox shortcuts.

* Ctrl-A Edit, Select All
* Ctrl-C Edit, Copy
Ctrl-F Edit, Find
Ctrl-F1 Help, Online Contents
Ctrl-G Edit, Go To
Ctrl-H Edit, Replace
Ctrl-I Edit, Initial Capital
Ctrl-L Edit, Lowercase
Ctrl-N File, New
Ctrl-O File, Open
Ctrl-Q Tools, QuickCrypt
Ctrl-S File, Save
Ctrl-T Edit, Transpose
Ctrl-U Edit, Uppercase
* Ctrl-V Edit, Paste
* Ctrl-X Edit, Cut
* Ctrl-Z Edit, Undo
F1 Help, Local Contents
F3 Edit, Find Next
F5 Edit, Date/Time
F6 Tools, Password
Shift-F3 Edit, Find Previous


Revised 2013-10-06