Introducing LaTeX
LaTeX is perhaps one of the most amazing and overlooked document formats every created! It's well suited for professional typesetting as a document's content is completely seperated from its style. What's the catch? LaTeX is typically edited in a code setting not a what-you-see-is-what-you-get setting, also referred to as WYSIWYG. It is the goal of this introduction to LaTeX to formilliarize one with the basics of LaTeX.
Like other languages, LaTeX has a method of commenting available. A comment line simply is prefixed with a percentage symbol like so:
% introduction.tex - Getting started with LaTeX
After some optional introductory comments, it is customary to specify the formatting desired for the LaTeX document. Here's how it's done:
\documentclass{article}
As one may imagine, other formatting styles are available besides article. In fact, a user may even wish to import his or her own custom document classes, as LaTeX refers to them. Besides article, other popular LaTeX document classes include:
- book
- letter
- report
Up to this point, the LaTeX document has been nothing but what is often called preamble. The following command specifies that anything before its ending tag, which is also displayed, is part of the document's actual contents:
\begin{document}
\end{document}
The beginning and ending tags accept other parameters besides document. Some popular ones include:
- abstract
- quote
- titlepage
- verse
At this point, one may wonder how he or she would go about displaying a % or \ in a document. They can't just be typed in normally because that would signify a comment line or a LaTeX command. Here's how it's done:
- To display a % enter \%
- To display a \ enter \textbackslash
Take a moment to consider the following LaTeX complete LaTeX document:
-----------
% This is a comment.
% Comments can be inserted anywhere in LaTeX documents.
\documentclass{article}
\begin{document}
Woo! Some text in a document.
\end{document}
-----------
The previous document can be compiled as a PDF by issuing the following command on a system with LaTeX installed:
latex introduction.tex
The compilation command assumes that the previous document has been saved as "introduction.tex." Actually ".tex" is not even required for compilation even if the saved file has the extension.
Another, and more newbie friendly way, of working with LaTeX would be to use a graphical front-end such as Kile. Kile is a wonderful KDE application available at:
kile.sourceforge.net
Happy hacking,
Samuel
--------
Credits:
- www.comp.leeds.ac.uk/andyr/misc/latex/tutorial1.html
- Autocompletion from Kile
Tuesday, August 09, 2005
Monday, August 08, 2005
In a nutshell, paired key encryption and decryption is one of the best ways to increase data security. Say an employee of a company needs to transfer a top-secret document to a fellow employee at another physical site. And say that the information was to be transfered over the Internet! Could this be accomplished in a way that would agravate melicious hackers to no end? You bet it could! First the sender would encrypt the secret file with the receivers public key. It's important to note at this point that there is no such thing as absolute security, only varying degrees. Still, the key can be made complex and incredibly hard to crack. Anyway, the file is now sent over the Internet to the destination a company site. The receiving employee needs to use his private key to decrypt the file. It is critical that the private key is never distributed to anyone else or across any insecure medium, such as the Internet. This is because the private key is the only key that is capable of easily decrypting the secret file, if the correct password is provided.
Digital signatures add to the security of paired key encryption. A signature is applied to a file as it is encrypted by mixing the file's contents and the sender's own private key. The receiver uses the sender's public key to varify the signature, as well as the actual contents of the file!
Even with all this, one attack is still possible. Say the a company employee got the receivers public key from a server off of the Internet. What if that key had been replaced with a milicious hacker's special version. Why the hacker could then decrypt the file with his own private key as it travels over the Internet. He might even be able to re-encrypt the file with the intended receiver's true public key so that no one would notice what had just happened! The solution to this is using a web of trust. Public keys can be signed by others. Then those others can have their public keys signed as well. In this way, webs of trust are developed where people vouch for each others public keys.
GnuPG is capable of generating key pairs of various sizes. It's minimum is 768 bits and, in the case of RSA keys, can go up to 4096 bits! Although the NSA could theoretically hack a key of this monsterous size, it would be fun to see them try with current and near-future technology. When I do my personal banking online a mere 128 bit RC4-MD5 encryption scheme is used! On the down side, larger keys require more time to create and use than smaller keys. The following is good practice when generating passwords that are tougher to break:
- Make the password long.
- Use a mix of upper and lower case letters.
- Insert numbers and symbols among the letters.
- Never use personal information such as birthdays!
- And never ever use a single plain English word!
It's important not to lose or unintentionally give the private key away once it is generated. If it's lost, any files encrypted with its public counter part are rendered useless. If security is compermised by the private key falling into another persons hands, the revoke certificate should be used. It's also generated at the same time as its associated key pairs.
Digital signatures add to the security of paired key encryption. A signature is applied to a file as it is encrypted by mixing the file's contents and the sender's own private key. The receiver uses the sender's public key to varify the signature, as well as the actual contents of the file!
Even with all this, one attack is still possible. Say the a company employee got the receivers public key from a server off of the Internet. What if that key had been replaced with a milicious hacker's special version. Why the hacker could then decrypt the file with his own private key as it travels over the Internet. He might even be able to re-encrypt the file with the intended receiver's true public key so that no one would notice what had just happened! The solution to this is using a web of trust. Public keys can be signed by others. Then those others can have their public keys signed as well. In this way, webs of trust are developed where people vouch for each others public keys.
GnuPG is capable of generating key pairs of various sizes. It's minimum is 768 bits and, in the case of RSA keys, can go up to 4096 bits! Although the NSA could theoretically hack a key of this monsterous size, it would be fun to see them try with current and near-future technology. When I do my personal banking online a mere 128 bit RC4-MD5 encryption scheme is used! On the down side, larger keys require more time to create and use than smaller keys. The following is good practice when generating passwords that are tougher to break:
- Make the password long.
- Use a mix of upper and lower case letters.
- Insert numbers and symbols among the letters.
- Never use personal information such as birthdays!
- And never ever use a single plain English word!
It's important not to lose or unintentionally give the private key away once it is generated. If it's lost, any files encrypted with its public counter part are rendered useless. If security is compermised by the private key falling into another persons hands, the revoke certificate should be used. It's also generated at the same time as its associated key pairs.
Subscribe to:
Posts (Atom)
