Sunday, 22 September 2013

Character Encoding


In the beginning, there was ASCII, and things were simple. But they weren't good, for no one could write in Cyrillic or Thai. So there exploded a proliferation of character encodings to remedy the problem by extending the characters ASCII could express. This ridiculously simplified version of the history of character encodings shows us that there are now many character encodings floating around.
character encoding tells the computer how to interpret raw zeroes and ones into real characters. It usually does this by pairing numbers with characters.
Information on a computer is stored and transmitted in what are called bits. Certain bits or combinations of bits equate to certain characters.
...The "charset" parameter identifies a character encoding, which is a method of converting a sequence of bytes into a sequence of characters. This conversion fits naturally with the scheme of Web activity: servers send HTML documents to user agents as a stream of bytes; user agents interpret them as a sequence of characters. The conversion method can range from simple one-to-one correspondence to complex switching schemes or algorithms...

There are many different types of character encodings floating around, but the ones we deal most frequently with are ASCII, 8-bit encodings, and Unicode-based encodings.
·         ASCII is a 7-bit encoding based on the English alphabet.
·         8-bit encodings are extensions to ASCII that add a potpourri of useful, non-standard characters like é and æ. They can only add 127 characters, so usually only support one script at a time. When you see a page on the web, chances are it's encoded in one of these encodings.
·         Unicode-based encodings implement the Unicode standard and include UTF-8, UTF-16 and UTF-32/UCS-4. They go beyond 8-bits and support almost every language in the world. UTF-8 is gaining traction as the dominant international encoding of the web.
Why do I need Character Encoding?
You need to include character encoding because:
  1. The declaration of character encoding is required as of the HTML 4.01 specification.
  2. When a browser renders/parses a web document that does not have the character encoding declared it will guess at what character set to use and may choose the wrong one therefore rendering the web page incorrectly.
  3. The visitor may have changed the default character encoding on their machine (Internet Explorer: View, Encoding) and it may not match the character encoding intended for the web document.
  4. It helps speed up your web pages.
When choosing a character encoding choose one that will be versitle, covering all the different languages and requirements of your intended audience. Unicode (UTF-8) is a very versitle character encoding to choose

Thursday, 19 September 2013

Delegation of Duties

In Backtrack5 r3 sql are already installed.
So go on backtrack>services>MYSQLD>MYSQL START

Now open a terminal and write as below:
root@bt:~# mysql -u root -p
Enter password:           // u will be asked for password ,so in backtrack ,default MYSQL password is "toor" and it nothing to do with ur computer root password,so, enter "toor as password"
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 45
Server version: 5.1.63-0ubuntu0.10.04.1 (Ubuntu)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database admin;
Query OK, 1 row affected (0.00 sec)

mysql> create user 'usr'@'localhost' identified by 'usrpass';
//'usr' is a username
//'localhost' is a name of the machine on which mysql is running , u can also use ip address on which mysql is running
//'usrpass' is a password which u want to set for user 'usr'
Query OK, 0 rows affected (0.00 sec)

mysql> use admin;
Database changed
mysql> create table tbl(name varchar(20));
Query OK, 0 rows affected (0.08 sec)

mysql> exit;  //exit as root and login as user that u have created
Bye
root@bt:~# mysql -u usr -p //login as user and enter the password which u had set in above case it was 'usrpas'
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 46
Server version: 5.1.63-0ubuntu0.10.04.1 (Ubuntu)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
+--------------------+
1 row in set (0.00 sec)
// so now u can observe that there is no database above becz 'usr'has not been granted permission
mysql> exit;
Bye
root@bt:~# mysql -u root -p //login as root & lets grant permission to 'usr'
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 47
Server version: 5.1.63-0ubuntu0.10.04.1 (Ubuntu)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> grant select,insert,create on admin.* to 'usr'@'localhost';//granting permission to user 'usr'
'admin.*'    means database 'admin' and '*' means all table of  'admin'
In above user 'usr' has been granted permission of select,insert and create to the all table of database ' admin'

Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges; //actually ur all information of user are stored in a file ,so after editing if u are using flush then it reload the updation.So after editing use flush
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye
root@bt:~# mysql -u usr -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 48
Server version: 5.1.63-0ubuntu0.10.04.1 (Ubuntu)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| admin              |        //so now u can see that 'admin ' is also visible to user 'usr', becz he has been granted     by the admin
+--------------------+
2 rows in set (0.00 sec)

mysql> use admin
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+-----------------+
| Tables_in_admin |
+-----------------+
| tbl             |          //table is also visible to user
+-----------------+
1 row in set (0.00 sec)

mysql>//now further if  'usr ' try to update any table of  'admin' database then error will be generated

Tuesday, 17 September 2013

Comparison between DES & RSA






Execution Time for Decryption of different Data Packet Size:


                                             Final difference:






Friday, 13 September 2013

Information Security Jobs In Government of India depatments

India manage its Information Security Infrastructure by following 6 agencies:


  1. Department of Electronics and Information Technology (DEITy)
    •  Indian- Computer Emergency Response Team (CERT-In)
    • National Informatics Centre (NIC)
  2.  Department of Telecom (DoT)
  3. National Technical Research Organisation (NTRO)
  4. Ministry of Defence
  5. Intelligence Bureau (IB)
  6. Defence Research and Development Organisation (DRDO)
so these are the agencies in which an Information Security Professional can work .