Q:

Encryption & Decryption Question

Greetings all
i want to know how to make good encryption and decryption for something in java 
and is is possible for anyone to decrypt something encrypted ?

A:

It's always possible.  Encryption/decryption is only as good as the underlying algorithm.  Given enough time and computing power, anything can be done.
Try http://www.jasypt.org/

A:

Edited to be more technically correct

... is possible for anyone to decrypt something encrypted ?

The encryption algorithm will dictate how long it will take for someone to decrypt your encrypted data, like duffymo said.  
WEP for wireless routers would be a good example of an security algorithm that does not take much time to break.  The underlying encryption algorithm (RC4) is easily exploitable due to it used in the wrong context.  RC4 is not broken, the designers used RC4 for the wrong application.
http://en.wikipedia.org/wiki/Wired_Equivalent_Privacy#Flaws
If you use an encryption algorithm in the wrong context, then you may be building false sense of security.

A:

Cryptography is a big subject with a long history, but the basic idea is that you're using a "secret" to prevent someone else from seeing something (data, a message, etc). There are many ways to hide information, but the best ones are based on time-tested, mathematically sound algorithms. For that reason, it's uncommon for a layperson (i.e. not a mathematician or advanced computer science guru) to write a successful encryption algorithm from scratch. Instead, most people use one of the existing set of algorithms, some of which (like AES) are international standards. These combine a publicly-known "scrambling" algorithm with a small "secret" key that only you (or a small group) know; without the key, you can't get the data. 
There are cases where "brute force" can be used to get the data--for example, trying every possible key. This, of course, takes time and computing power, and for a sufficiently large key size, is effectively impossible (i.e. there are more possible keys than the number of atoms in the universe). 
So, if you use a well known, well tested algorithm, with a large key, you can be pretty assured that your data can't be gotten by force. 
(Of course, there are other ways to skin a cat--like calling you pretending to be someone who should know the key, and getting you to tell them ...)
There are java libraries for every major encryption algorithm that you can simply include in your project and use (as @duffymo said, http://www.jasypt.org/ is a good place to start).

