Visit the authors website for real step-by step tutorials on how to make video games (for free): Make-Video-Games.com You can also find more information about computer summer camps and links to colleges that offer them.
Archive for December, 2009
Learn Video Game Design and Programming by Attending a Summer Camp
A video game design summer camp is an extraordinary way to introduce a teen to the highly creative, and teamwork oriented world of game design.
The industry of video game design is an extraordinarily creative industry and very similar to the Hollywood movie making industry. A diverse group of people with a lot of different skills work together as a team to create a movie, and the same thing happens in the creation of a video game.
The Industry needs, and actively looks for people that are highly creative, great team players, and highly skilled in a variety of disciplines. This is a fact of life in the world of making games and it is a dramatic change from industries that have been around a long time. This is not our father’s work world. It is exactly these three components that a summer camp offers a teen. It gives the attendees a creative environment where teamwork is developed and specific computer skills are learned.
If you are considering going to a camp for designing games there are a couple of things you should think about. First of all, the world of game making is very diverse and there are a lot of different programs and applications that can be used, so you have to consider what areas of game making you are interested and then look for a camp that covers that. A good example of what I mean is that you can learn how to design levels, program code, make java games, create 3d models, or any number of other things. There are also quite a few different programs that you could master from 3ds MAX for modeling to FPS Creator for level and game design. And what you want to do in the realm of game making will determine which skills and applications you should learn.
So, you should carefully consider what kinds of things about making video games appeal to you and try to find a camp that will fill that requirement. If you are a parent considering sending a teen or child to a camp you should spend time talking with him or her about what is interesting about video games. Chances are good he or she will know more about making games than you do. Your teen may like three-dimensional modeling, graphic design, writing or level design. This is a big factor in whether the camp will be a success or not. It’s a matter of fulfilling individual goals and needs.
Your first course of action in looking for a summer camp should be to check with your local University or Community College. Just about every institution like this has summer learning programs for kids and teens. And unless you are already a student there you probably would never learn about the programs being offered so all it takes is a phone call and a request for a brochure. If geographic location is not a big concern for you there are plenty of top grade institutions that offer one week or two week long programs.
Summer camps are a great way to immerse a teen or child in the highly creative world of video game design and programming. It is a great way to get a feel for the career potential in the industry. And as a bonus he or she is actually going to come home from the camp with a real and complete video game that he or she made!
Symmetric Cryptography in Java
Symmetric cryptography in Java
Introduction
As you know data security is a significant aspect of any enterprise application. Starting from password encryption to any data exchange, cryptography has been in use for all kinds of purpose. However there are two kinds of cryptography, one is symmetric and another is asymmetric. In case of symmetric cryptography, a secret key is used for all kinds of encryption and decryption. This secret key is shared by all the members who want to participate in the encryption and decryption process. There are several algorithms for the symmetric cryptography. DES( Data Encryption Standard) is one of them. In case of normal login screen of web based application, implementation of DES algorithm is used for password encryption.
Technicalities
Java cryptography provides suitable and flexible framework for the use of symmetric cryptography. DES algorithm is commonly known as symmetric algorithm. In case of symmetric cryptography, the secret key is used in a plain text file and this file is shared between the members. This file is used to retrieve the secret key for all kinds of encryption and decryption. In this regards I can provide you an example that think of a situation where the two lovers receive their love letters in encrypted format so that no body can read it. They have a common key called the DES secret key. They use the secret key to decrypt the contents of the encrypted love letters at their end. It means that the secret key is generated once and shared between the members. For more details of DES algorithm please refer to the java docs and JCE framework provided by Sun. In this article I will provide an example of how to use the implementation of DES algorithm.
Complete example
The following is the utility class for the cryptography management. The class name is
“KeyUtil.java”.
package com.dds.core;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import javax.crypto.Cipher;
import javax.crypto.CipherInputStream;
import javax.crypto.CipherOutputStream;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
/**This is a utility class for all kinds
* of useful methods related to symmetric
* cryptography. This class only provides
* the use of DES algorithm.You can use any
* other symmetric algorithm similarly.
* @author Debadatta Mishra( PIKU )
*
*/
public class KeyUtil {
/**
* Name of the algorithm
*/
private static String algorithm = “DES”;
/**This method is used to obtain the
* Secret key as a String. It is useful
* you can store the String in a file
* for all kinds of encryption and
* decryption.
* @return the SecretKey as String
*/
public static String generateSecretKey() {
String secretKeyString = null;
try {
KeyGenerator keyGen = KeyGenerator.getInstance(algorithm);
SecretKey secretKey = keyGen.generateKey();
byte[] secretKeyBytes = secretKey.getEncoded();
secretKeyString = new sun.misc.BASE64Encoder()
.encode(secretKeyBytes);
} catch (Exception e) {
e.printStackTrace();
}
return secretKeyString;
}
/**This method is used to obtain the SecretKey
* object by passing the secret key as string.
* @param secretKeyString of type String
* @return object of {@link SecretKey}
*/
private static SecretKey getKeyInstance(String secretKeyString) {
SecretKey secretKey = null;
try {
byte[] b2 = new sun.misc.BASE64Decoder()
.decodeBuffer(secretKeyString);
secretKey = new SecretKeySpec(b2, algorithm);
} catch (Exception e) {
e.printStackTrace();
}
return secretKey;
}
/**This method is used to encrypt the same file.
* This method is useful when you are encrypting
* the contents of a file. There is no need to
* create another file with the encrypted contents.
* @param filePath of type String indicating the path of the file
* @param keyString of type String indicating the secret key
*/
public static void encryptFile(String filePath, String keyString) {
try {
SecretKey key = getKeyInstance(keyString);
Cipher ecipher = Cipher.getInstance(algorithm);
ecipher.init(Cipher.ENCRYPT_MODE, key);
InputStream in = new FileInputStream(filePath);
byte[] fileBytes = new byte[in.available()];
in.read(fileBytes);
in.close();
OutputStream out = new FileOutputStream(filePath);
out = new CipherOutputStream(out, ecipher);
out.write(fileBytes);
out.close();
} catch (Exception e) {
e.printStackTrace();
}
}
/**This method is used to decrypt the same file.
* This method is useful when you are decrypting
* the contents of a file. There is no need to
* create another file with the decrypted contents.
* @param filePath of type String indicating the path of the file
* @param keyString of type String indicating the secret key
*/
public static void decryptFile(String filePath, String keyString) {
try {
SecretKey key = getKeyInstance(keyString);
Cipher ecipher = Cipher.getInstance(algorithm);
ecipher.init(Cipher.DECRYPT_MODE, key);
InputStream in = new FileInputStream(filePath);
byte[] fileBytes = new byte[in.available()];
in.read(fileBytes);
in.close();
OutputStream out = new FileOutputStream(filePath);
out = new CipherOutputStream(out, ecipher);
out.write(fileBytes);
out.close();
} catch (Exception e) {
e.printStackTrace();
}
}
/**This method is used to encrypt the contents
* of a file and writing to another file. This
* method is useful when you want to maintain the
* original contents and encrypting the contents
* and giving to another person.
* @param in of type {@link InputStream}
* @param out of type {@link OutputStream}
* @param keyString of type String indicating the SecretKey
*/
public static void encryptFile(InputStream in, OutputStream out,
String keyString) {
byte[] buf = new byte[1024];
try {
SecretKey key = getKeyInstance(keyString);
Cipher ecipher = Cipher.getInstance(algorithm);
ecipher.init(Cipher.ENCRYPT_MODE, key);
// Bytes written to out will be encrypted
out = new CipherOutputStream(out, ecipher);
// Read in the cleartext bytes and write to out to encrypt
int numRead = 0;
while ((numRead = in.read(buf)) >= 0) {
out.write(buf, 0, numRead);
}
out.close();
} catch (Exception e) {
e.printStackTrace();
}
}
/**This method is used to decrypt the contents
* of a file and writing to another file. This
* method is useful when you want to decrypt
* the contents and writing to a another file.
* @param in of type {@link InputStream}
* @param out of type {@link OutputStream}
* @param keyString of type String indicating the SecretKey
*/
public static void decryptFile(InputStream in, OutputStream out,
String keyString) {
byte[] buf = new byte[1024];
try {
SecretKey key = getKeyInstance(keyString);
Cipher dcipher = Cipher.getInstance(algorithm);
dcipher.init(Cipher.DECRYPT_MODE, key);
in = new CipherInputStream(in, dcipher);
int numRead = 0;
while ((numRead = in.read(buf)) >= 0) {
out.write(buf, 0, numRead);
}
out.close();
} catch (Exception e) {
e.printStackTrace();
}
}
/**This method is used to encrypt the String.
* @param contents of type String
* @param keyString of type String indicating the Secret key as String
* @return a String encrypted contents
*/
public static String getEncryptedContents(String contents, String keyString) {
String encryptedString = null;
try {
byte[] contentBytes = contents.getBytes();
SecretKey key = getKeyInstance(keyString);
Cipher ecipher = Cipher.getInstance(algorithm);
ecipher.init(Cipher.ENCRYPT_MODE, key);
byte[] encryptedBytes = ecipher.doFinal(contentBytes);
encryptedString = new sun.misc.BASE64Encoder()
.encode(encryptedBytes);
} catch (Exception e) {
e.printStackTrace();
}
return encryptedString;
}
/**This method is used to decrypt the String.
* @param contents of type String
* @param keyString of type String indicating the Secret key as String
* @return a String encrypted contents
*/
public static String getDecryptedContents(String contents, String keyString) {
String decryptedString = null;
try {
byte[] contentBytes = new sun.misc.BASE64Decoder()
.decodeBuffer(contents);
SecretKey key = getKeyInstance(keyString);
Cipher ecipher = Cipher.getInstance(algorithm);
ecipher.init(Cipher.DECRYPT_MODE, key);
byte[] encryptedBytes = ecipher.doFinal(contentBytes);
decryptedString = new String(encryptedBytes);
} catch (Exception e) {
e.printStackTrace();
}
return decryptedString;
}
}
The above class provides several useful methods for encryption and decryption. Please refer the java docs provided for each method. Generally in many applications, you may have to use either for a file or for a String. In the above class , I have provided two methods for file encryption and decryption. In certain situation, it is required that you have to encrypt the contents of the file. More specifically I can provide you an example, think about a file called “sample.txt”. You have to encrypt the contents of the file “Sample.txt” so that after encryption when you are opening the file, it becomes unreadable. It may also be required to transfer the file to network. Sometime a requirement comes that there is file called “Sample.txt”, you have to encrypt the contents of the file and to create a new file called “Sample_en.txt”. In this case you have two files, one is the original one as well as the encrypted file. Now refer to the following subordinate classes for the use.
Class name: KeyGenerator.java
package com.dds.core;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.util.Properties;
/**
* This class is used to generate the secrete key and
* stores the secret key in a file called secret.key.
* @author Debadatta Mishra(PIKU)
*
*/
public class KeyGenerator {
/**This method is used to obtain the
* path of the file secret.key.
* @return path of Key
*/
private static String getKeyFilePath() {
String keyPath = null;
try {
String keyDirPath = System.getProperty(“user.dir”) + File.separator
+ “key”;
File keyDir = new File(keyDirPath);
if (!keyDir.exists())
keyDir.mkdirs();
keyPath = keyDirPath + File.separator + “secretkey.key”;
} catch (Exception e) {
e.printStackTrace();
}
return keyPath;
}
/**
* This method is used to store the
* secret key in a file.
*/
public static void storeKey() {
try {
Properties keyProp = new Properties();
OutputStream out = new FileOutputStream(getKeyFilePath());
keyProp.put(“key”, KeyUtil.generateSecretKey());
keyProp
.store(out,
“Secret key information, do not modify the key.”);
} catch (Exception e) {
e.printStackTrace();
}
}
}
This class is used to generate the Secret key and to store in a file so that the secret key can be retrieved as and when required. Let us see another class where you can read the secret key file to get the secret key.
Class name: KeyReader.java
package com.dds.core;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;
/**This is a utility class to read the
* contents of the secret.key file.
* @author Debadatta Mishra(PIKU)
*
*/
public class KeyReader {
/**This method is used to obtain the
* key String which is stored in the
* file secret.key.
* @return the key String
*/
public static String getSecretKey() {
String secretKeyString = null;
try {
String keyDirPath = System.getProperty(“user.dir”) + File.separator
+ “key”;
String keyPath = keyDirPath + File.separator + “secretkey.key”;
Properties keyProp = new Properties();
InputStream in = new FileInputStream(keyPath);
keyProp.load(in);
secretKeyString = keyProp.getProperty(“key”);
} catch (Exception e) {
e.printStackTrace();
}
return secretKeyString;
}
}
The above class is used to read the secret key.
I provide below all the test harness classes for the above classes. The first test harness class is “KeyGeneratorTest.java”.
import com.dds.core.KeyGenerator;
/**This is a test harness class to generate
* the secret key and store in a file.
* @author Debadatta Mishra(PIKU)
*
*/
public class KeyGeneratorTest {
public static void main(String[] args) {
KeyGenerator.storeKey();
}
}
This class is used to generate the secret key.
The next test harness class is “StringEncryptionTest.java”.
import com.dds.core.KeyReader;
import com.dds.core.KeyUtil;
/**This test harness class is used to
* encrypt and decrypt the String.
* @author Debadatta Mishra(PIKU)
*
*/
public class StringEncryptionTest {
public static void main(String[] args) {
String originalString = “Hello World”;
String secretKeyString = KeyReader.getSecretKey();
String encryptedStringContents = KeyUtil.getEncryptedContents(
originalString, secretKeyString);
System.out.println(“Original String——” + originalString);
System.out.println(“Encrypted String—–” + encryptedStringContents);
/*
* Now get back to your originalString by decryption
*/
String decryptedString = KeyUtil.getDecryptedContents(
encryptedStringContents, secretKeyString);
System.out.println(“Decrypted String—–” + decryptedString);
}
}
The above class is used to encrypt and decrypt a String. It may be useful for for your password and some other String of characters. Let us see the class for file encryption.
Class Name : FileEncryptionTest.java
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import com.dds.core.KeyReader;
import com.dds.core.KeyUtil;
/**This is the test harness class for the
* encryption and decryption of the file.
* @author Debadatta Mishra(PIKU)
*
*/
public class FileEncryptionTest {
public static void main(String[] args) throws Exception {
String filePath = “C:/output.txt”;
String secretKeyString = KeyReader.getSecretKey();
/*
* Encrypt the fileContents and write to the same file
*/
KeyUtil.encryptFile(filePath, secretKeyString);
/*
* Decrypt the file contents and write to the same file
*/
KeyUtil.decryptFile(filePath, secretKeyString);
/*
* Encrypt the file contents and write to another
* file which contains the encrypted contents.
*/
String encryptedFilePath = “C:/en.txt”;
InputStream in = new FileInputStream(filePath);
OutputStream out = new FileOutputStream(encryptedFilePath);
KeyUtil.encryptFile(in, out, secretKeyString);
/*
* Decrypt the file contents and write to an another file.
*/
in = new FileInputStream(encryptedFilePath);
out = new FileOutputStream(filePath);
KeyUtil.decryptFile(in, out, secretKeyString);
}
}
The above class provides several ways you can encrypt and decrypt the file.
Please follow the following sequence to execute the above classes.
Conclusion
I hope that you will enjoy my article for the symmetric cryptography. For asymmetric cryptography please refer to the link http://www.articlesbase.com/information-technology-articles/asymmetric-cryptography-in-java-438155.html. If you find any problems or errors, please feel free to send me a mail in the address debadattamishra@aol.com . This article is only meant for those who are new to java development. This article does not bear any commercial significance. Please provide me the feedback about this article.
Debadatta Mishra – An agressive java developer with a differenece.
Digital Slide Copier Instructions And Information Document.
Information And Instructions For Digital Camera Slide Copier Devices. Slide Copiers Allow You To Transfer Your Old Photographic Slides And Film Into Digital Format. This Document Has Been Refined For Over 8 Years By A Company That Sells These Copiers.
EMule Downloads – Download EMule – 420 Million and Counting
In May 2002, a guy named Merkur expressed his dissatisfaction with some of the existing peer-to-peer file sharing applications. He specifically pointed his finger to the now-discontinued eDonkey 2000. His dissatisfaction for the said program gave rise to the emule, yet another peer-to-peer file sharing application, only bigger and better. The problem with other file sharing application is that they do not have some features that users can really benefit from. Searching for files online is already a taxing job and users don’t have to endure other downloading mishaps, whether minor or major.
Getting a corrupted file after hours of download is not exactly your idea of hassle-free downloads. If you download emule, you will realize how stress-free file downloading and file sharing can be. Taking its cue from the early peer-to-peer file sharing applications, the emule team made sure that emule is packed with new features that will make your downloading and file sharing experience as hassle-free and as enjoyable as possible. With over 400 million emule downloads, you are guaranteed that the system that emule utilizes is far better than other file sharing applications. One emule download and you will be taken into a new world of hassle-free file downloading experience.
With emule’s open source policy, the application has had many updates and revisions, which can only be a good thing. Open source allows developers all over the world to share and contribute their work and ideas to the cause of the project. The great thing about this is that with every update, users are getting all the awesome features that other programs can only dream about. The emule remains true to the endeavors of peer-to-peer file sharing developers, but it offers more than just easy access to massive amounts of file from millions of users. If you download emule, you will get access to millions of movie and music files in various formats. With such massive amount of files, you will definitely get a download overload, but in a good way. Whether you are downloading to or 10 files, you are assured that you will get them all without any errors. You don’t even need to monitor the status of each download because the program does that for you.
With massive emule downloads happening every hour, you know you will have access to more and more files. What’s more exciting is that you can get the chance to talk with other users in real time via the built-in IRC client. You can also send and receive messages from your friends without having to open your email or any other instant messaging service. You will be able to see your friends if they are online. If you are quite anti-social, you can still make use of emule’s built-in web services and a web service that allows you to have quick access to the Internet. If that doesn’t catch your fancy, you can preview all the files that you are downloading. Yes, viewing a file while the download is not yet finished is possible. So, there’s plenty to do while downloading files. If everything else fails, you can stare at the pretty GUI. To download the latest version visit DownloadeMuleProUltra2.com
