There is an awkward technological trend we are seeing today. Earlier the mobile phones were shrinking in size but now the trend is backwards. The mobile phones are getting bigger and they are as big as 7 or 9 inches? Err.. They are called tablets. But such big phone? Okay, I am sounding so old school.
To admit the reality, yes, the phones are no more just phones and no less than computers. But it is also true, they are not computers yet. The growing functionalities in a mobile phone are making the phones not anymore phones but a device to use your other stuff. And thanks to apple for the sexy touch technology which initiated the touch phones and then touch tablets.
Recently I was planning to buy such a device. I consulted so many people who are using such devices on shall I buy a tablet or shall I go for a good smart phone. In true form what they answered me was not at all conclusive and decisive and because of that I still am in dilemma. The reason of dilemma is, that people do not find them too greatly useful in nature.
Tablets are still limited in functionalities
The functionalities of tablets if you compare to smart phones are not any great. They possess similar camera, same email/chat/interent capabilities. They both give you video calling. Then why shall I spend more to buy a device which is bulkier in looks, not at all sexy as a cool mobile phone looks and are superbly difficult to carry. Moreover, the tablets (I would not call them PCs) do not surely give you the entier functionality a laptop can. If you are a software developer or do a creative design work, tablets are of no use. Also, if I anyway have to buy a bag to carry my tablet, why I would not buy a laptop which is today cheaper than this cool sexy pocket sucking tablets and gives much more in terms of functionality.
Tablets are limited in terms of peripherals as well. Biggest example memory. A tablet can at max have a memory of 64GB. For a laptop it can be upto 500GB-1TB. External memory devices? There are very limited tablets which have this capability of entertaining external memory drives such as thumb drives or external HDD’s. But with laptops there is no compromise. For gaming you can use any number of devices and for creative works use any number of devices present like joy sticks, pens etc but no such capability is there with tablets.
Smart phones are truly smart
I am a software engineer myself and belong to an industry where the tiny little parts, the actualy processing units, of these super sexy devices are made. What we dream of today being in this industry is that we will keep making more powerful devices with more computing power than ever in the same or lesser size. I would love to see a mobile phone acting like a computer. A little bigger size say 4-4.5 inches looks more than enough to me for such a use.
The phones such as Samsung Galaxy SII or Sony Ericsson Xperia series I am too much fond of. They give you a big enough screen size to read books easily, good gaming experience and a true support for all business needs with email and everything you can think of.
Today’s Tablets are defeating the technological trend by giving no signficant gain over smart phones and to me are totally useless devices until you have a specific need of only reading and checking your emails with limited replies you have to do and you are truly in need of a bigger screen with no functionality of a true computer.
Moreover, you are not going to put the tablet on your cheek and talk like you do on phone. You can not keep tablet in your pocket. So, phone functionality is of least use with a tab.
If I have to suggest someone who is going to buy a new device I would strongly be in favor of a good screen size mobile phone and a strict no for a tablet. However, it is everyone personal choice in terms of functionality requirements and money you can or want to spend.
Please leave your comments and tell what you think of the percieved notion I have.
-Aerosum
About Author
Sumit Arora (aerosum) is a software engineer in Cadence Design Systems which makes Electronic Design Automation softwares used for microchip designing.
Gnu Privacy Guard or GnuPG or popularly known as GPG is a GPL Licensed alternative to PGP (Pretty Good Privacy) and its openPGP complaint program for *nix people based on rfc 4880. It is part of GNU software project started in 1991 by Werner Koch and majorly funded by German Government. Download its pdf format from here.
Its basic use is to send encrypted mails or files to the recipient who can decrypt these using its private key. It is based on public and private key mechanism for encryption/decryption. We can encrypt any of our data using our own key pair and send it to the person who can read the message if he has the proper key to decrypt it! Many people use public key generated by gpg to verify his email signature too!
It uses following algorithm for various purposes used for safe message communication:
Pubkey: RSA, RSA-E, RSA-S, ELG-E, DSA
Cipher: 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH
Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2
Why GPG?
Because it is free and meant to be a replacement of PGP.
Gpg is a CLI program but there are many GUI also through which you can manage keys easily like seahorse for GNOME (yum install seahorse) and KGpg for KDE.
It allows you to encrypt and sign your data, includes a key management system as well as access modules for all kind of public key directories.
If you wish to encrypt your message while sending mail to someone important, you may try this method.
You can share your public key and other users can download it to verify signature in mails/files sent by you for authenticity. It would stop social engineering through email even would stop spams send in the name of your friend’s id.
Applications of GPG
GPG encryption has been added to graphical email client like Evolution for email security.
There is a GNOME front-end application for managing PGP and SSH keys called “Seahorse” which integrates with Nautilus, gedit and Evolution too for encryption, decryption etc.
Enigmail is a data encryption/decryption extension for Mozilla Thunderbird and the SeaMonkey which uses GPG
Mozilla Firefox also gets GPG enabled using Enigform.
GnuPG is being used for Windows Explorer and Outlook through GPG4win tool which are wrapped in the standard Windows installer to make GnuPG easier to get installed and to be used in Windows systems.
It uses hybrid encryption techniques i.e. it uses a combination of symmetric key cryptography for speed and public-key cryptography for easy secured key exchange. By default GnuPG uses the CAST5 symmetrical algorithm.
As a matter of fact, GnuPG does not use patented or otherwise restricted software or algorithms. Instead, GnuPG uses a variety of other, non-patented algorithms.
It will be clearer that how GnuPG works once we see the working of gpg commands step by step:
Which version of gpg we are going to use?
gpg command to generate keys
Analysis of freshly created directory (.gnupg) and files inside it.
Once you get public and private key. You must keep private key safe, once you forget it then you will never be able to decrypt the data. So, better take private key backup.
Want to see the list of public and private keys?
Encrypt the message for specific recipient
Decrypt the encrypted message
GPG commands explained
Which version of gpg we are going to use?
[vim][sjaiswal@AlienCoders ~]$ gpg –version
gpg (GnuPG) 1.4.5
Copyright (C) 2006 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.
[vim][sjaiswal@AlienCoders ~/gpg_test]$ gpg –gen-key
gpg (GnuPG) 1.4.5; Copyright (C) 2006 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.
Please select what kind of key you want:
(1) DSA and Elgamal (default)
(2) DSA (sign only)
(5) RSA (sign only)
Your selection? 1
DSA keypair will have 1024 bits.
ELG-E keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048) 4094
Requested keysize is 4094 bits
rounded up to 4096 bits
Please specify how long the key should be valid.
0 = key does not expire
<n> = key expires in n days
<n>w = key expires in n weeks
<n>m = key expires in n months
<n>y = key expires in n years
Key is valid for? (0) 3m
Key expires at Mon 03 Feb 2014 04:46:09 AM MST
Is this correct? (y/N) y
You need a user ID to identify your key; the software constructs the user ID
from the Real Name, Comment and Email Address in this form:
"Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>"
Real name: Sanjeev Jaiswal
Email address: sjaiswal@gmail.com
Comment: "GPG Key Test"
You selected this USER-ID:
"Sanjeev Jaiswal ("GPG Key Test") <sjaiswal@gmail.com>"
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
You need a Passphrase to protect your secret key.
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
.++++++++++.+++++++++++++++..+++++..++++++++++++++++++++.+++++++++++++++++++++++++.
+gpg: /home/sjaiswal/.gnupg/trustdb.gpg: trustdb created
gpg: key CBE9BE42 marked as ultimately trusted
public and secret key created and signed.
To generate keys using gpg, it would ask which kind of key you wish to use; you can choose any of the given option. Type 1 or 2 or 5.
Type the keysize between the given range
Then provide the expiration date of key. You can use days,weeks, months, years.
Once you are done with expiration days, use the next option carefully. Type Real name, Email and comment appropriately as it will be used while encrypting the data and will ask the recipient name. it will match recipient name before matching the keys.
Then type anything using keyboard, do mouse activities etc to speed up random generation of keys else it may take lot of time.
Once it will get created, .gnupg directory under your home directory will be there. Use ls to see what all files got created.
Analysis of freshly created directory (.gnupg) and files inside it
gpg.conf -> it contains all options set by you. Unless you specify which option file to use (with the command line option "–options filename"), GnuPG uses the file ~/.gnupg/gpg.conf by default. Check strings gpg.conf for more details.
pubring.gpg -> public key stored here. You should export it in ASCII format to send it to others.
pubring.gpg~ -> backup of public key
random_seed -> it contains all random keys used for encryption that you might be typing while generating keys.
secring.gpg -> it’s the secret key ring and one should keep it safe. Better have its backup
trustdb.gpg -> its trusted db which contains signatures, expiration date etc. and from time to time the trust database must be updated so that expired keys or signatures and the resulting changes in the Web of Trust can be tracked.
Normally, GnuPG will calculate when this is required and do it automatically.
Type the message and save it in text file, let’s say message.txt
[vim][sjaiswal@AlienCoders ~/.gnupg]$gpg recipient Sanjeev Jaiswal –encrypt message.txt
[/vim]
It will create message.txt.gpg , which is an encrypted file. To decrypt it, you need to type passphrase that you had typed while generating keys.
Or
[vim]gpg -r real-name –out secrets_to_aliencoders –encrypt secrets
[/vim]
which will have encrypted message in secrets_to_aliencoders
You need a passphrase to unlock the secret key for
user: "Sanjeev Jaiswal ("GPG Key Test") <sjaiswal@gmail.com>"
4096-bit ELG-E key, ID 38765DB9, created 2013-11-05 (main key ID CBE9BE42)
gpg: encrypted with 4096-bit ELG-E key, ID 38765DB9, created 2013-11-05
"Sanjeev Jaiswal ("GPG Key Test") <sjaiswal@gmail.com>"
Hi
This is Sabnjeev
Or
[vim][sjaiswal@AlienCoders ~/.gnupg]$ gpg –output secrets_from_tom –decrypt secrets_to_aliencoders
[/vim]
Which would save the decrypted message in secrets_from_sanjeev
Editing Key
[vim]gpg –edit-key sjaiswal@gmail.com
[/vim]
There is more:
Photo IDs
GnuPG has the ability to add a photo ID to a public key, exactly as in recent Windows versions of PGP. A photo ID attached to a public key can help other users to identify the owner of the key. To add a photo ID to your own public key, use the command "gpg –edit-key <name>" and then enter "addphoto". GnuPG will ask for the filename of a suitable JPEG. No other types of image files can be used.
If you want to see a photo ID on a particular key, enter the command "–show-photos" before using the command "gpg –list-keys <name>". If <name> is omitted, GnuPG will display all the photos (if any) after listing all the keys in your public keyring. Alternatively, if you want photos to be displayed in all cases by default, you should uncomment the line "# show-photos" in the options file inside !GnuPGUser.
Output of trustdb
[vim][Sanjeev@AlienCoders]$ gpg –update-trustdb
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0 valid: 1 signed: 7 trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: depth: 1 valid: 7 signed: 3 trust: 0-, 0q, 4n, 3m, 0f, 0u
gpg: the next trustdb check will be done on 2014-02-04
[/vim]
The first line shows you the actual trust policy used by your GnuPG installation, and which you can modify at your needs. It states that a key in your keyring is valid if it has been signed by at least 3 marginally trusted keys, or by at least one fully trusted key.
The second line describes the key of level 0, that is the key owned by you. It states that in your keyring you have one level zero key, which is signed by 7 keys. Furthermore among all the level zero keys, you have 0 of them for which you haven't yet evaluated the trust level. 0 of them are the keys for which you have no idea of which validity level to assign (q="I don't know or won't say"). You also have 0 keys that you do not trust at all (n="I do NOT trust"), 0 marginally trusted keys (m="I trust marginally"), 0 fully trusted keys (f="I trust fully") and 1 ultimately trusted keys (u="I trust ultimately").
The third line analyzes the keys of level 1 in your keyring. You have 7 fully valid keys, because you have personally signed them. Furthermore, among the keys that are stored in your keyring, you have 3 of them that are not signed directly by you, but are at least signed by one of the fully valid keys. The trust status counters have the same meaning of the ones in the second line. This time you have 4 keys signed by you but for which you do not trust at all the owner as signer of third party's keys. On the other side, 3 of the 7 keys that you have signed are marginally trusted. This means that you are only marginally confident that the owners of those keys can verify well the keys that they sign.
[vim][Sanjeev@AlienCoders]$ gpg –check-trustdb
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0 valid: 1 signed: 7 trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: next trustdb check due at 2014-02-04
[/vim]
If you wish to know other commands that you may use using gpg then try
[vim]man gpg
[/vim] or
[vim]gpg –help
[/vim]
What is Hibernate and how it works – a minimal introduction
During my post graduations we had to make a project based on the requirement, at that time I heard about a word hibernate. But at that time I was not so much curious about it. I only know that it is a kind of framework. My friends was used it in their project also but I was not aware about it so I use my own Java coding for all stuff.
But when I joined an organization I came to know that here also we are using hibernate but now the situation was very difficult because I did not know A, B, C… of it. But my senior level was very cooperative and they help me a lot to overcome from the situation. So now I want to share my knowledge with you people so that in future you will not face this problem. So let’s start with the basic question what, when, why and how?
What is Hibernate?
Hibernate is a free, open source Java package that makes it easy to work with relational databases. It provides a query service for Java. Hibernate lets you develop independent classes following common Java idiom – including association, inheritance, polymorphism, composition and the Java collections framework. Hibernate is basically used with J2EE (Java web application).
It is a very popular open source technology which fits well both with Java and .NET technologies. The Hibernate 3.0 core is 68,549 lines of Java code. Hibernate maps the Java classes to the database tables. It also provides the data query and retrieval facilities that significantly reduce the development time. Hibernate can be used in Java Swing applications, Java Servlet-based applications, or J2EE applications using EJB session beans. Hibernate is free software that is distributed under the GNU Lesser General Public License. Source: wikipedia
When Hibernate?
Hibernate was started in 2001 by Gavin King as an alternative to using EJB2-style entity beans. Its mission was to simply offer better capabilities than EJB2(Enterprise Java beans) by simplifying the complexities and allowing for missing features. Early in 2003, the Hibernate development team began Hibernate2 releases which offered many significant improvements over the first release.
JBoss, Inc. (now part of Red Hat) later hired the lead Hibernate developers and worked with them in supporting Hibernate. On 9th Feb 2012 they have released a stable version of hibernate as Hibernate 4.1 final. It is developed in Java language so it uses JVM as a platform for the execution.
Why Hibernate?
It is the most important question that why we need hibernate into our application? So let’s discuss it in very simpler way. We know that when we develop any application, at that time for storing our data we required a database.
For example we are making a web base application for the Post-Office and here we have to keep track of all the information related to post, money order, courier etc. For the information storage point of view we use a MySQL as a backend database and we have code all things into a Java class like how to add data into database or how to perform operation on that data base. Now when we are going to deliver the product (i.e. our application) suddenly client requirement got changed and now they want ms access as their database because it is freely available and it can be easy to understand.
Can you imagine the situation now? You have a limited amount of time and you have to change your each and every class which is dealing with the database and the worst thing is that now you have to change all 50 files because it is a live application (this number can be 5000 also depend upon the scenario) . To handle this kind of situation hibernate came into picture. Hibernate provide an API (Application programming Interface) with all build in functions like insert (), delete (), update () etc. It also provides persistence architecture for a code (each class is independent). Here we follow a standard hibernate architecture in which we use xml for all the configuration settings.
How It Works?
Hibernate does not get in your way nor does it force you to change the way your objects behave. They do not need to implement any interfaces in order to become persist. All you need to do is create an XML "mapping document" telling Hibernate the classes you want to be able to store in a database, and how they relate to the tables and columns in that database, and then you can ask it to fetch data as objects, or store objects as data for you. At runtime, Hibernate reads the mapping document and dynamically builds Java classes to manage the translation between the database and Java program.
Now there is one question related to hibernate which was asked to me during my campus interview but at that time I was not able to answer it. Let’s find the answer
What is dirty checking?
Hibernate automatically detects object state changes in order to synchronize the updated state with the database, this is called dirty checking. An important note here is, Hibernate will compare objects by value, except for Collections, which are compared by identity. For this reason you should return exactly the same collection instance as Hibernate passed to the setter method to prevent unnecessary database updates.
Now I will discuss an example for a simple Java application, if you have basic knowledge in Java and JDBC (Java Database Connectivity), then you will understand it comfortably.
Suppose you have to make an application which will maintain records of the entire employee present in your office. So we will do it in the following way
A GOOGLE Wave is an application by google that collaborates several Google features. A user who has installed Google wave will be able to access and use Google features like Orkut, Google Talk and Gmail efficiently.
Google wave can also check for errors (grammatical and spelling) as well translate text to forty different languages. Google has not yet announced when Wave will be released.
For the User’s Convenience, Google will open source part of the code so that users can develop or Modify the features of the program. Upcoming days , no need to use of different browser , in Single place you can use all features of google. Microsoft is working on Project Known as ‘NATAL’ , which on completion would probably be the new face of gaming. It involves gaming without the use of any controllers. End users will be able to play games or interact with the interface with gestures and spoken commands on their existing Xbox consoles. The device would be around nine inches and a motion sensor would be placed either above or below the device. It would feature face and voice recognition as well as full body 3D motion capturing capabilities.
Observers are expecting it to be launched up to end of 2010.
Visitor Rating: 5 Stars