After the without password zip file extraction process, I start hunting password protected zip file extraction process. After Two days research I found out a web site, which is available free and open source jar file .From that jar file we can extract a password protected zip file. That jar file is zip4j.jar file .you can find out this jar file and it’s information in the following URL.
http://lingala.net/zip4j/
I have downloaded the zip4j.jar file
And I have implemented the following source code
=================================================
import java.io.IOException;
import net.lingala.zip4j.core.ZipFile;
import net.lingala.zip4j.exception.ZipException;
import net.lingala.zip4j.io.Zip4jInputStream;
/**
*
* @author Administrator
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws IOException {
// TODO code application logic here
try{
ZipFile zipFile = new ZipFile("c:\\zip\\29111001.124.zip");
// Check to see if the zip file is password protected
if (zipFile.isEncrypted()) {
// if yes, then set the password for the zip file
zipFile.setPassword("abcd");
}
zipFile.extractFile("29111001.124.txt", "c:\\zip\\12\\");
}catch(ZipException ex){
System.out.println("error "+ ex );
}
}
}
=======================================================
In this program
zip file is available at c:\\zip\\29111001.124.zip
and extracted file is available at c:\\zip\\12\\ folder
Here "abcd" is the password used to extract zip file.
Note :- i have write down this source code for benefit of all the java programmer.
Thursday, January 6, 2011
How to extract a zip file (without password protected) using java Program
I have assigned a job, which has a module to read a password protected zip file using java program. At the beginning I was able to write a java using ZipInputStream class.( java.util.zip package).In that program I can extract zip file ,which does not have password protection. But when it comes to password protected zip file extraction, java.util.zip package does not support. For the zip file without password it works very well.
Here is the sample code i have use for that
==============================================================
import java.io.*;
import java.util.zip.*;
public class UnzipExample
{
public static void main(String a[])
{
try
{
BufferedOutputStream out = null;
ZipInputStream in = new ZipInputStream
(new BufferedInputStream(new FileInputStream(a[0])));
ZipEntry entry;
while((entry = in.getNextEntry()) != null)
{
int count;
byte data[] = new byte[1000];
out = new BufferedOutputStream(new
FileOutputStream("out.txt"),1000);
while ((count = in.read(data,0,1000)) != -1)
{
out.write(data,0,count);
}
out.flush();
out.close();
}
}catch(Exception e)
{
e.printStackTrace();
}
}
}
===========================================================
According to this source code we have to pass the zip file name ,when it run the program (run time).
===================================
java UnzipExample 11.zip
===================================
In this program, "out.txt" is the output file
Here is the sample code i have use for that
==============================================================
import java.io.*;
import java.util.zip.*;
public class UnzipExample
{
public static void main(String a[])
{
try
{
BufferedOutputStream out = null;
ZipInputStream in = new ZipInputStream
(new BufferedInputStream(new FileInputStream(a[0])));
ZipEntry entry;
while((entry = in.getNextEntry()) != null)
{
int count;
byte data[] = new byte[1000];
out = new BufferedOutputStream(new
FileOutputStream("out.txt"),1000);
while ((count = in.read(data,0,1000)) != -1)
{
out.write(data,0,count);
}
out.flush();
out.close();
}
}catch(Exception e)
{
e.printStackTrace();
}
}
}
===========================================================
According to this source code we have to pass the zip file name ,when it run the program (run time).
===================================
java UnzipExample 11.zip
===================================
In this program, "out.txt" is the output file
Wednesday, December 22, 2010
Water pump market in Sri Lanka
Today I got an idea to write down a article about water pump in sri lankan market.I had to buy a water pump ,because my home need one.Home had a water pump ,which is 20 years old.It’s a ANTON Brand.That water pump is good one,but now ANTON is not in the water pump market any more.So difficult to repair that old water pump.So I decide to buy new one. There fore first I have done a research on water pumps in sri lanka.
I have found out following brand of water pumps in sri lanka.
1.Jinesena
2.Solex
3.Arpitec
4.singer
5.Z-lon

Jinesena ,It’s the sri lankan most popular brand for the water pump since 1932 .It’s spare parts for available every way in sri lanka.This brand water pump are durable.Price wise it’s the no 1 water pump. 3/4 horse power brand new water pump will be nearly 16,000 – 18,000 sri lanka rupees. This brand product had ISO 9001 and ISO 9001/2000 certification. Jinesena water impeller is made from white steel .So it’s durable . They also produce Industrial Pumps and Agricultural Pumps. You can reach Jinesena product by dialing 011 2584919 or visit www.jinasena.com

Solex ,not famous than Jinesena.But It had potential market in sri lanka.Solex water pump spare parts wildly available throughout the sri lanka.It’s spare parts are more cheaper than compare to Jinesena.If you are buy a water pump for a home ,this is the right brand.This brand available in sri lanka since 1980.This brand had a ½ horse power water pump. you can buy ½ horse power brand new water pump nearly 8,000 -10,000 sri lanka rupees.3/4 horse power brand new water pump will be 12,000 -14,000.Solex water impeller is made from copper .So it’s durable .They issues you 5 years warranty. You can reach Solex product by dialing 11 2931730 or visit www.solexeng.com.

Arpitec,product of Arpico people. Arpico people came to water pump market very recently. So unlike Jinsena,Solex Arpitec do not have rich history in water pump market. Arpitec impeller is made from steel.So it might get damage.Price wise it’s cheaper than Jinesena and Solex both.you can buy ¾ horse power brand new water pump 10,000 SL rupees.1/2 horse power one 6,000 SL rupees.you can reach Arpico water pump by dialing 11 4310500 or visit www.arpico.com

Singer ,came to water pump market latter part of the 90.They are spare parts are widely available. They suction speed is less compare to Jinsena and solex.They had various selection,not like other brand.So you can buy a good suction speed water pump with ¾ horse power 14,000 SL rupees. you can reach Singer water pump by dialing 11 2316316 or visit www.singersl.com
Z-lon,came to water pump market very recently.They are the cheapest brand in sri lanka.You can buy ¾ horse power water pump 8,000 – 9,000 SL rupees.Spare parts are not widely available.spare parts are available in a limited area.i have no idea about it’s impeller. you can reach Z lon water pump by dialing 114760100.
All these information are base on my own personal experience.If you are hope to buy a new water pump better to visit all these brands .After that get some idea about each and every brand. Next decided what your requirement is. After that select the brand and capacity you need .They buy a water pump according to your requirement.In this article I point out nutshell of the water pump market in sri lanka .There can be other brand,But i found out only these brands in sri lanka.Any way good luck for your water pump hunting job.
I have found out following brand of water pumps in sri lanka.
1.Jinesena
2.Solex
3.Arpitec
4.singer
5.Z-lon

Jinesena ,It’s the sri lankan most popular brand for the water pump since 1932 .It’s spare parts for available every way in sri lanka.This brand water pump are durable.Price wise it’s the no 1 water pump. 3/4 horse power brand new water pump will be nearly 16,000 – 18,000 sri lanka rupees. This brand product had ISO 9001 and ISO 9001/2000 certification. Jinesena water impeller is made from white steel .So it’s durable . They also produce Industrial Pumps and Agricultural Pumps. You can reach Jinesena product by dialing 011 2584919 or visit www.jinasena.com

Solex ,not famous than Jinesena.But It had potential market in sri lanka.Solex water pump spare parts wildly available throughout the sri lanka.It’s spare parts are more cheaper than compare to Jinesena.If you are buy a water pump for a home ,this is the right brand.This brand available in sri lanka since 1980.This brand had a ½ horse power water pump. you can buy ½ horse power brand new water pump nearly 8,000 -10,000 sri lanka rupees.3/4 horse power brand new water pump will be 12,000 -14,000.Solex water impeller is made from copper .So it’s durable .They issues you 5 years warranty. You can reach Solex product by dialing 11 2931730 or visit www.solexeng.com.

Arpitec,product of Arpico people. Arpico people came to water pump market very recently. So unlike Jinsena,Solex Arpitec do not have rich history in water pump market. Arpitec impeller is made from steel.So it might get damage.Price wise it’s cheaper than Jinesena and Solex both.you can buy ¾ horse power brand new water pump 10,000 SL rupees.1/2 horse power one 6,000 SL rupees.you can reach Arpico water pump by dialing 11 4310500 or visit www.arpico.com

Singer ,came to water pump market latter part of the 90.They are spare parts are widely available. They suction speed is less compare to Jinsena and solex.They had various selection,not like other brand.So you can buy a good suction speed water pump with ¾ horse power 14,000 SL rupees. you can reach Singer water pump by dialing 11 2316316 or visit www.singersl.com
Z-lon,came to water pump market very recently.They are the cheapest brand in sri lanka.You can buy ¾ horse power water pump 8,000 – 9,000 SL rupees.Spare parts are not widely available.spare parts are available in a limited area.i have no idea about it’s impeller. you can reach Z lon water pump by dialing 114760100.
All these information are base on my own personal experience.If you are hope to buy a new water pump better to visit all these brands .After that get some idea about each and every brand. Next decided what your requirement is. After that select the brand and capacity you need .They buy a water pump according to your requirement.In this article I point out nutshell of the water pump market in sri lanka .There can be other brand,But i found out only these brands in sri lanka.Any way good luck for your water pump hunting job.
Thursday, November 25, 2010
more information about PGP encryption
If you install PGP command line version and also if you had .pgp file and it's key in a .asc file.
then you can decrypt the file using the following command.
pgp --import key.asc
pgp --decrypt file.pgp
for the GPG command line it's in the following way.
gpg --import key.asc
gpg --decrypt file.pgp
How Confidentiality generate from PGP encryption
Here message or file is encrypted using a symmetric encryption algorithm, which requires a symmetric key. Each symmetric key is used only once and is also called a session key. The session key is protected by encrypting it with the receiver's public key thus ensuring that only the receiver can decrypt the session key. The encrypted message along with the encrypted session key is sent to the recipient.
then you can decrypt the file using the following command.
pgp --import key.asc
pgp --decrypt file.pgp
for the GPG command line it's in the following way.
gpg --import key.asc
gpg --decrypt file.pgp
How Confidentiality generate from PGP encryption
Here message or file is encrypted using a symmetric encryption algorithm, which requires a symmetric key. Each symmetric key is used only once and is also called a session key. The session key is protected by encrypting it with the receiver's public key thus ensuring that only the receiver can decrypt the session key. The encrypted message along with the encrypted session key is sent to the recipient.
Thursday, November 4, 2010
What is AS 400
AS 400 is a midrange server designed for small businesses and departments in large enterprises and now redesigned so that it will work well in distributed networks with Web applications. The AS/400 uses the PowerPC microprocessor with its reduced instruction set computer technology. Its operating system is called the OS/400. With multi-terabytes of disk storage and a Java virtual memory closely tied into the operating system, IBM hopes to make the AS/400 a kind of versatile all-purpose server that can replace PC servers and Web servers in the world's businesses, competing with both Wintel and Unix servers, while giving its present enormous customer base an immediate leap into the Internet.
Wednesday, November 3, 2010
Pretty Good Privacy (PGP)
Pretty Good Privacy (PGP) is a data encryption and decryption computer program that provides cryptographic privacy and authentication for data communication.It increase the security of e-mail communications.It was created by Philip Zimmermann in 1991.
PGP is based on the public-key method, which uses two keys -- one is a public key that you disseminate to anyone from whom you want to receive a message. The other is a private key that you use to decrypt messages that you receive.
Following step help to create public key and after export that key we can send it to other end.(communication other party)
Step 1: -
pgp –version
check the PGP version
Step 2:-
pgp –h
get the pgp help
Step 2:-
pgp --gen-key "Joe User" --key-type RSA --bits 2048 --passphrase "my passphrase"
create pgp public key
Here Joe User is the key word we are used.
Key-type -> RSA should be the correct one to select two way communication. The default is DH/DSS and should be fine for new users.
Bits ->
1024 or 2048 is fine. 2048 or greater will be much better to used.
Below 1024 is not good. Then crackers can easily guess the public key.
Passphrase -> This is one of the most important steps (next to backing
up your keyring). If someone were to get a hold of your secret key, and figure
out your passphrase then there is NOTHING that you can do to prevent that
person from opening your encrypted files or reading your mail.
The passphrase should be a good length, and include upper and lower case
characters, number and symbols. A good choice is to make a sentence and
add punctuation and numbers. Of course, you should not write it down
anywhere where others may find it. If your passphrase is weak, then it can be
hacked.
After execute the above command ,
PGP Command line will now generate your keypair. You should see your Key ID (i.e. 0X12345678), and a message that the key was successfully generated.
Step 3:-
pgp --list-keys
list the public keys in the PGP server
Step 4:-
pgp --export 0x12345678
Export The Public Key
Now Public key creation process is over.
After that you can send the export public key to customer
After sending the customer your public key , we have to collect customer’s public key
First we need to import that public key.
pgp --import "PGP Joe.asc"
PGP Joe.asc is the public key of the customer
For this way we can use PGP encryption process.
PGP is based on the public-key method, which uses two keys -- one is a public key that you disseminate to anyone from whom you want to receive a message. The other is a private key that you use to decrypt messages that you receive.
Following step help to create public key and after export that key we can send it to other end.(communication other party)
Step 1: -
pgp –version
check the PGP version
Step 2:-
pgp –h
get the pgp help
Step 2:-
pgp --gen-key "Joe User" --key-type RSA --bits 2048 --passphrase "my passphrase"
create pgp public key
Here Joe User is the key word we are used.
Key-type -> RSA should be the correct one to select two way communication. The default is DH/DSS and should be fine for new users.
Bits ->
1024 or 2048 is fine. 2048 or greater will be much better to used.
Below 1024 is not good. Then crackers can easily guess the public key.
Passphrase -> This is one of the most important steps (next to backing
up your keyring). If someone were to get a hold of your secret key, and figure
out your passphrase then there is NOTHING that you can do to prevent that
person from opening your encrypted files or reading your mail.
The passphrase should be a good length, and include upper and lower case
characters, number and symbols. A good choice is to make a sentence and
add punctuation and numbers. Of course, you should not write it down
anywhere where others may find it. If your passphrase is weak, then it can be
hacked.
After execute the above command ,
PGP Command line will now generate your keypair. You should see your Key ID (i.e. 0X12345678), and a message that the key was successfully generated.
Step 3:-
pgp --list-keys
list the public keys in the PGP server
Step 4:-
pgp --export 0x12345678
Export The Public Key
Now Public key creation process is over.
After that you can send the export public key to customer
After sending the customer your public key , we have to collect customer’s public key
First we need to import that public key.
pgp --import "PGP Joe.asc"
PGP Joe.asc is the public key of the customer
For this way we can use PGP encryption process.
Wednesday, October 13, 2010
Sri Lankan Milk production




Sri Lanka is an island.Plenty of greenery and sunshine are freely available.
In 2006 Sri Lanka produced 7000 Metric Tons of Powdered Milk.Main four sri lankan companies have help for these production.But the pathetic situation is sri lanka imports 68000 Metric Tons of Powdered Milk.That is too much.Why can not sri lanka made it's own requirement ? Do we need to import such massive qty from other countries ?
But this situation is much recovered in 2008 ,In 2008 Sri lanka produced 7500 Metric Tons of Powdered Milk.But Still Sri Lanka had to import 62000 Metric Tons from the other countries.
Major Powdered Milk production compaines are Nestle,Milco,Kothmale and Maliban.
But all these companies are famous for manufacturing following product(Milk food).
* UHT Tetra Milk
* Cheese
* Yoghurt
* Ice Cream
* Fresh Cream
* Ghee
* Curd
* Milk Powder
* Butter
* Sterilized Milk
Sri lanka is in front of Milk food production.In 2008 Sri lanka produced 2800 Metric Tons of Milk food.But still In 2008 Sri lanka had to import 50 Metric Tons from other countries.
Subscribe to:
Posts (Atom)