Chapter 12. Keychain Scripting and Apple VerifierMac OS 9 ships with a number of applications and files that help users protect their files, folders, and passwords from intruders. Apple Computer groups these technologies under the Apple Data Security umbrella term. These software tools include:
Look in the startup disk:Applications:Security folder and you will find the Apple File Security and Apple Verifier programs. Apple File Security allows you to encrypt and decrypt files using a passphrase of five or more characters that you create. You must remember this password unless you have used Keychain Access with the file encryption, which is explained later in this chapter. Encryption mathematically scrambles the file data into a hodge-podge of nonsensical ASCII characters that look like Example 12-1, which is part of this paragraph after it was encrypted. It is extremely difficult, if not impossible (if they do not have your passphrases), for unintended or malicious recipients to break the code and decipher encrypted files. Example 12-1. A Sample Portion of an Encrypted File_!Åm¿__-#8_ÁÎ>°CºE_$ëBj,/Z.·,©._fnB,"VS'íu,>…£1Ë-_éSI_{_ÇRôY] *oe}g_ Z2<Ú¯e)EifÍ3&bEa_Ü__E,â#@aÍ'ÌÌ·k_m].¿__'__AQHuè·Ë…e>>é¤>/_>¯>Ø>_>=_>S> N- Just open a file from Apple File Security's File menu, and it will prompt you for a password before encrypting it. You can also encrypt a file from the Finder's File menu in Mac OS 9. Finally, just drag the file over the Apple File Security icon and it displays the dialog window that Figure 12-1 shows. If you checked the "Add to Keychain" checkbox when you encrypted the file (see Figure 12-1), then you can just double-click the file later to decrypt it (return it to its readable and insecure state). If you did not add the passphrase to a keychain then you haveto recall the password to decrypt it. Otherwise, no one (including Apple's engineers) will be able to help you decrypt the file. So do not encrypt that email exonerating you and your company from abusing a software monopoly unless you plan to remember the passphrase. Figure 12-1. Apple File Security adds an encrypted file passphrase to a keychainApple File Security is not scriptable with Mac OS 9, but another security program that works closely with Apple's encryptionmethod can be used with AppleScript—Keychain Access. This is a control panel, but its scripting functions are accessible through the Keychain Scripting software tucked away with the scripting additions in the startup disk:System Folder:Scripting Additions folder. Figure 12-1 shows the checkbox that allows you to add a passphrase for an encrypted file to a keychain. Again, in Mac OS 9, a keychain is a password file or database that is stored in encrypted form in startup disk:System Folder:Preferences:Keychains. You can have one or more keychains as long as you give them unique names. The keychain is designed to provide automatic passwords for:
Not all of this functionality (e.g., using Keychain Access with web sites) was widely available by Winter 2001, but keychains are very useful with files and AppleShare servers.For example, once you have added an AppleShare key to a keychain, then you can mount the specified volume simply by clicking a button (it says "go there") in Keychain Access's Get Info window for that AppleShare key. Again, Keychain Access is a control panel that is located in startup disk:System Folder:Control Panels. Apple Verifier is the other scriptable security application that this chapter describes. Another part of Apple Data Security services is Apple Code Signing. Apple Code Signing is a new Mac OS 9 technology that allows developers to digitally sign applications, plug-ins, and content. Digital certificates are unique IDs that you can apply to software (such as a program that you have coded) so that the software's recipients can be sure that it came from you (and so that you cannot deny that it came from you!). Apple Code Signer is another security program that is only distributed with the Apple Security Software Development Kit. Software security and crytography are very interesting but large subjects, so I recommend that you try external information sources to learn more about them.
This chapter will describe AppleScripting with Keychain Scripting and Apple Verifier, which is Apple Computer's program for checking the digital signatures of files or programs that you download from some potentially insecure source such as the Web. |