Sunday, April 4, 2010

Cryptographic Algorithms

There are many cryptographic algorithms(Ciphers) that are used to secure information.
These can be divided into following categories:

Symmetric Ciphers : Uses same key for encryption and decryption.

>>>>Stream ciphers : RC4

>>>>Block ciphers : AES, DES, DESede, SEED

Asymmetric Ciphers : Uses different key for encryption and decryption.RSA,DSA

RC4
RC4 is a stream symmetric cipher. operations are performed by XORing plain text bits with key bits.
AES
AES stands for Advance Encryption Standard. It was accepted as a NIST standard. AES has a fixed block size of 128 bits.
AES is a block symmetric cipher. It divides the plain text into blocks (128 bytes). AES Keys can be of 128,192 or 256 bits long.
DES
DES is a block symmetric cipher. DES keys are 56 bits long.
DESede
DESede is also a block symmetric cipher derived from DES.
RSA
RSA is an asymmetric cipher.
choose your plaintext be at least one byte shorter than the RSA modulus, and before RSA encryption, pad or encrypt the message content.
See http://forums.devshed.com/security-and-cryptography-17/plaintext-max-size-calculation-for-rsa-610111.html


DSA
DSA is asymmetric cipher.

Perl

Perl is a scripting language. Scripts written in perl requires the perl executable to execute them.

Hello World Script:

#!/usr/bin/perl

print "Hello World!";

Capturing the output of command in perl variables

$output = `ls -l`;

Using system call to execute commands

system("cp src dst");

Difference b/w double quotes string and single quoted string

print "name is $name" : expands $name and prints it.

print 'name is $name' : prints $name as it is.

Perl is available for many systems; check http://www.cpan.org

Shell Scripting

if constuct
The if condition can test various conditions.

Usage of if to test successful execution of commands:
if cp src dst
then
echo "cp succeeded"
fi

Usage of test directive with if:
if test a -lt b
then
echo "a < b"
fi

Usage of if with [ ]
if [ a -lt b ]
then
echo "a < b"
fi

IBM Power Systems

IBM Power Systems are servers based on IBM Power 6 / 7 architecture. They have the capability to run Linux, AIX and IBMi operating systems.

IBMi was formerly called OS/400. Developers familiar with Unix/Linux systems can use the PASE and QSH interface for development.

Here is a brief description of terminology associated with the IBM Power Systems.


CCSID

In qsh, the environment variable QIBM_CCSID controls the CCSID assigned to new files that are created.

US English - EBCDIC 37