Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!

 

1. JPA Mini Book

2. JVM Troubleshooting Guide

3. JUnit Tutorial for Unit Testing

4. Java Annotations Tutorial

5. Java Interview Questions

 

and many more ....

 

 

DES with ECB example

In this example we shall show you how to encrypt data using the DES algorithm in ECB mode. To encrypt a String message with the Data Encryption algorithm in Electronic Code Book mode one should perform the following steps: Create a byte array from the initial String message, and a byte array to be used as a key. Create a ...

Read More »

DES with CBC example

With this example we are going to demonstrate how to encrypt data using the DES algorithm in CBC mode. In short, to encrypt/decrypt a String message with the Data Encryption Standard algorithm, in Chipher Block Chaining mode you should: Create a byte array to be used as initial input, a byte array to be used as a key and a ...

Read More »

DES with CTR example

This is an example of how to encrypt data using the DES algorithm in CTR mode. Doing data encryption with the Data Encryption Standard algorithm, in CTR mode implies that you should: Create a byte array to be used as initial password to be encrypted, a byte array to be used as a key and a a byte array to ...

Read More »

Encrypt/Decrypt with with AES/ECB/PKCS7Padding

In this example we shall show you how to encrypt/decrypt data with the AES/ECB/PKCS 7Padding. To encrypt data using the AES algorithm,in ECB mode and with PKCS7Padding one should perform the following steps: Create a byte array to be used as input to be encrypted and a byte array to be used as a key. Create a new SecretKeySpec for ...

Read More »

Symmetric encryption example

With this example we are going to demonstrate how to make a symmetric encryption and decryption. In symmetric encryption the same key is used for both encryption of plaintext and decryption of ciphertext. In short, to make a symmetric encryption you should: Create a byte array from the initial password and a byte array from the initial key. Create a ...

Read More »

AWTPermission example

This is an example of how to create an AWTPermission. AWTPermissions are permissions granted for the AWT Package of Java. In the AWTPermission API there is a list of all the possible AWTPermission target names, and for each one, there is a description of what the permission allows and a discussion of the risks of granting code the permission. In ...

Read More »

AccessController example

In this example we shall show you how to create and check an access permission to a file, using the AccessController Class. To create a new permission to a file and check the access permission of a file, one should perform the following steps: Create a new FilePermission with the specified path of the file and action mode of the ...

Read More »

Signing a Java Object example

With this example we are going to demonstrate how to sign a Java Object. In particular, we will use the Digital Signature Algorithm (DSA) to create a 1024-bit key pair and then sign a Serializable Object, using the key pair Signature. In short, to sign an Object in Java you should: Create a KeyPairGenerator for the DSA algorithm and initialize ...

Read More »

Get DSA parameters of a key pair example

This is an example of how to get DSA parameters of a key pair. In short, to get the DSA parameters of a key pair you should: Generate a 1024-bit Digital Signature Algorithm (DSA) key pair. Create a KeyPairGenerator for the DSA algorithm and initialize it with 1024-bit key size. Generate the KeyPair. Get the private and public key from ...

Read More »

Get bytes of a key pair example

In this example we shall show you how to get the bytes of a key pair in Java. To get the bytes of a key pair one should perform the following steps: Create a KeyPairGenerator for the DSA algorithm and initialize it with a 1024-bit key size. Generate the KeyPair, with the genKeyPair() API method of the KeyPairGenerator. Get the ...

Read More »