Milan Events – Up and Comming Events in 2010

Author: admin  //  Category: techno mix

Milan Airport Rent-A-Car

1

Public Design Festival

13 – 18 Apr 2010 (annual)

The Piazza XXIV Maggio square hosts Milan’s Public Design Festival, one of the most-awaited “Fuori Salone” events dedicated to public design and urban space. Projects, meetings, workshops and…

The opening of the Public Design Festival, Milan. Photo by Masiar Pasquali, courtesy of Public Design Festival
45.489021
9.29605

2

Pasqua del Canottaggio

17 – 18 Apr 2010 (annual)

Pasqua del Canottaggio is an important rowing regatta, bringing together university teams from all over the world. It is held at Easter time at the Idropark Fila, which is part of the Milan…

45.535442
9.049228

3

Salone Internazionale del Mobile

14 – 19 Apr 2010 (annual)

Held at the recently revamped Fiera Milano exhibition centre, the Salone Internazionale del Mobile is the biggest exhibition in the Milanese design calendar. It showcases the hottest and most…

A piece at the Salone Internazionale del Mobile, Milan. Photo by Saverio Lombardi Vallauri, courtesy of Salone Internazionale del Mobile
45.452333
9.176073

4

Antiques Market

25 Apr 2010 (monthly)

This Antiques Market stretches along the canal in Navigli for about two kilometres. Over 400 merchants set up stalls, while quality controls ensure merchandise is in good condition. Practise…

45.557425
9.214961

5

Abstract Photography

15 Nov 2009 – 2 May 2010; not Mon

Milan’s Museo di Fotografia Contemporanea exhibits Abstract Photography, a series of experimental works by the likes of Olivo Barbieri, Pierre Cordier, Luigi Veronesi and Jean-Louis Garnell.…

Luigi Veronesi, Fotogramma, 1978. Courtesy of Museo di Fotografia Contemporanea
45.49364
8.939796

6

Art on the Naviglio

8 – 9 May 2010 (annual)

Originally organised to represent a handful of Milanese painters, Art on the Naviglio today exhibits the work of around 300 artists from all over Italy. It is held along Milan’s historic…

Paintings displayed along the Naviglio Grande, Milan. Courtesy of Arte sul Naviglio
45.184364
9.497723

7

Fumettopoli

10 May 2010 (various dates)

With four annual editions at the Atahotel Executive, Fumettopoli is Milan’s most popular animation event. Collectors and aficionados congregate to complete their collections, swap, sell or buy…

QUIET PLEASE! Tom and Jerry’s Oscar winner in the category best cartoon USA 1945. Courtesy of the Mike Glad. collection, © Metro-Goldwyn-Mayer, Inc. / Turner Broadcast System Inc.
45.360249
9.108288

8

Black Eyed Peas

12 May 2010

LA-based quartet Black Eyed Peas perform at Milan’s Forum as part of their world tour on the back of latest album, The E.N.D.. The release showcases the outfit’s current slick, techno-pop sound.

Black Eyed Peas. Courtesy of AEG Europe
45.4695
9.282216

9

Brocantage

14 – 16 May 2010 (various dates)

The quality-controlled Brocantage is an antiques fair at the Parco Esposizioni Novegro in Milan. It is full of interesting old things, and certainly worth browsing for those with a streak of…

Quality pieces displayed at Brocantage Antiques Fair. Courtesy of Parco Esposizioni Novregro
45.4695
9.282216

10

Vinilmania

15 – 16 May 2010 (various dates)

The Vinilmania record fair at the Parco Esposizioni Novegro makes Milan a magnet for record-buffs and collectors from around the globe. Visitors come from as far as Japan to buy and sell their…

Looking for old records at Vinilmania, Milan. Courtesy of Vinilmania
45.360249
9.108288

11

KISS

18 May 2010

KISS bring their Sonic Boom Over Europe: From the Beginning to the Boom tour to Milan’s Mediolanum Forum. Famed for their face paint and flamboyant stage outfits, the band perform both old…

KISS. Courtesy of Live Nation
45.443832
9.151831

12

ArtExperience

May 2010 (annual)

The Domus Academy presents ArtExperience, a five-day event featuring meetings and seminars on contemporary art in Milan. Key figures from the international art scene debate the relationship…

Lambda print on aluminum, Carsten Nicolai 2000 – Photo credits to Uwe Walter
45.454549
9.202103

13

Experimental European Season

8 Oct 2009 – 23 May 2010 (annual)

Milan’s Teatro della Contraddizione presents its Experimental European Season, an event dedicated to language research in new theatre production. A vintage section focuses on historic shows…

A’ Cirimonia at the Experimental European Season, Milan. Courtesy of Teatro della Contraddizione
45.49457
9.182956

14

Gotan Project

27 May 2010

Gotan Project are a Paris-based group consisting of musicians Philippe Cohen Solal, Eduardo Makaroff and Christoph H Müller. They bring their brand of Nuevo tango to Alcatraz, Milan.

Gotan Project. Courtesy of Academy Music Group
45.472099
9.173382

15

Roy Lichtenstein – Meditations on Art

26 Jan – 30 May 2010; not Mon

In collaboration with the Roy Lichtenstein Foundation, the Milan Triennale presents Roy Lichtenstein – Meditations on Art, a massive retrospective dedicated to the king of pop art. There are…

Roy Lichtenstein – Meditations on Art, Triennale of Milan. Photo by Fabrizio Marchesi, © Estate of Roy Lichtenstein
45.452333
9.176073

16

Antiques Market

30 May 2010 (monthly)

This Antiques Market stretches along the canal in Navigli for about two kilometres. Over 400 merchants set up stalls, while quality controls ensure merchandise is in good condition. Practise…

45.478458
9.125336

17

Muse

8 Jun 2010

Bombastic 21st-century rock band Muse continue their tour in support of new album, The Resistance. The British trio bring their blistering live show and theatrical prog rock sound to Stade de…

Matthew Bellamy of Muse. Courtesy of SJM Concerts
45.47198
9.182346

18

MIX – Gay and Lesbian Film Festival

Jun 2010 (annual)

Held at the Teatro Strehler, Milan’s MIX – Gay and Lesbian Film Festival has been running for more than 20 years. It celebrates gay life with a week of screenings, discussions, forums and…

The Gay and Lesbian Film Festival logo, Milan. Courtesy of the Gay and Lesbian Film Festival
45.452883
9.247919

19

Maximal Festival

Jun 2010 (annual)

A 12-hour music marathon at Milan’s East End Studios, the Maximal Festival presents the very best of international techno. Some 40 artists from Europe and the USA perform on six stages.

Maximal Festival logo, Milan. Courtesy of Maximal
45.465443
9.190256

20

Milano Food Week

Jun 2010 (annual)

Milan’s Chiostri dell’Umanitaria and Galleria Vittorio Emanuele II are just two of the venues that host Milano Food Week, celebrating the pleasures of the table. Cinema, photography, workshops…

Milano Food Week logo, Milan. Courtesy of Milano Food Week
45.468929
9.181

21

Cannes e Dintorni

Jun 2010 (annual)

Cannes e Dintorni is Milan’s annual screening of films presented at the Cannes Film Festival. Films are shown at a number of cinemas including Spazio Oberdan, Anteo Spaziocinema, Colosseo…

<i>The US vs John Lennon</i>, by David Leaf e John Scheinfeld – 2006. Courtesy of Lombardia Spettacolo
45.446477
9.179308

22

Symphonic Season

10 Sep 2009 – 20 Jun 2010 (annual)

From September through to June La Verdi’s Symphonic Season offers a rich programme of classical music at Milan’s Auditorium. Expect melodies by great composers such as Bach, Beethoven, Mozart…

Performance at the Symphonic Season, Milan. © Fondazione Orchestra Sinfonica e Coro Sinfonico di Milano Giuseppe Verdi
45.479061
9.155645

23

Si SposaItalia

18 – 21 Jun 2010 (annual)

Fashion capital Milan organises Si SposaItalia, a bridalwear show held at Fieramilanocity. Breakfasts hosted by top designers, catwalk shows and a gala evening provide ample opportunities to…

Looking beautiful – bride and groom. Courtesy of Nicholas and Veronique Bartie
45.452333
9.176073

24

Antiques Market

27 Jun 2010 (monthly)

This Antiques Market stretches along the canal in Navigli for about two kilometres. Over 400 merchants set up stalls, while quality controls ensure merchandise is in good condition. Practise…

45.468929
9.181

25

La Milanesiana

Jun – Jul 2010 (annual)

La Milanesiana is Milan’s festival of international culture held throughout the city, even on public transport. Writers, musicians, actors, film directors, scientists and other creative minds…

La Milanesiana logo, Milan. Courtesy of La Milanesiana
45.45581
9.254044

26

La Notte di San Lorenzo Festival

Jul 2010 (annual)

Every year during July’s summer evenings, Milan’s Cascina Monluè becomes the stage for La Notte di San Lorenzo Festival. A series of free music concerts are held by artists from as far afield…

45.475282
9.178247

27

Milano Jazzin’ Festival

Jul 2010 (annual)

A recent addition to Milan’s summer calendar, Milano Jazzin’ Festival attracts an impressive line-up of performers to the Civic Arena. Despite its name, the festival also hosts famous blues…

Performing at Milano Jazzin’ Festival, Milan. Courtesy of Milano Jazzin’ Festival
45.554938
9.096841

28

Villa Arconati Festival

Jun – Jul 2010 (annual)

Located on the outskirts of Milan, Villa Arconati Festival was initially dedicated to classical music only but now it welcomes performances across various genres. The villa itself is…

The festival logo. Courtesy of Villa Arconati Festival
45.452333
9.176073

29

Antiques Market

25 Jul 2010 (monthly)

This Antiques Market stretches along the canal in Navigli for about two kilometres. Over 400 merchants set up stalls, while quality controls ensure merchandise is in good condition. Practise…

45.472099
9.173382

30

Architecture Festival

May – Jul 2010 (annual)

Organised by Milan’s Triennale, the Architecture Festival is a two-month event featuring dozens of exhibitions, meetings and conventions. These and several other cultural projects are based on…

An image from Renzo Piano’s Visible Cities. Annie Leibovitz, for Forest City Ratner Companies. NYT © 2007
45.360249
9.108288

31

Latinoamericando Expo

Jun – Aug 2010 (annual)

The spirit of Latin America strikes Milan as the city’s Forum hosts the Latinoamericando Expo. This cultural extravaganza creates a “South American village” featuring internationally renowned…

The Latinoamericando Expo logo, Milan. Courtesy of Latinoamericando srl
45.468929
9.181

32

Nights at the Museum

Jul – Aug 2010 (annual)

Organised by Milan City Council, Nights at the Museum is a series of cultural events taking place in the summer evenings. Concerts, theatre and dance performances, guided tours, talks and…

45.452333
9.176073

33

Antiques Market

29 Aug 2010 (monthly)

This Antiques Market stretches along the canal in Navigli for about two kilometres. Over 400 merchants set up stalls, while quality controls ensure merchandise is in good condition. Practise…

45.435292
9.228051

34

Italian Gay Open Tennis

Sep 2010 (annual)

The Italian Gay Open Tennis is the grand slam for gay and lesbian tennis enthusiasts, organised by the Association of Homosexual Tennis Players (A.T.OMO). It attracts around 150 players and…

The Italian Gay Open Tennis promotional flyer in 2009. Courtesy of A.T.OMO
45.468929
9.181

35

Milano in Sport

Sep 2010 (annual)

Football, badminton, martial arts, gymnastics and many, many more disciplines turn Milan’s pedestrianised city centre into a sports village for a whole weekend. Light shows, dog agility…

45.535442
9.049228

36

Bijoux

Sep 2010 (annual)

Costume jewellery show Bijoux provides the style-conscious Milanese with the perfect opportunity to find that all-important accessory to accompany their latest designer outfit. Around 100…

Accessories at Bijoux, Milan. Courtesy of Macef
45.535442
9.049228

37

Macef

Sep 2010 (annual)

The Fiera Milano hosts Macef, Milan’s biggest international trade event for homeware and design. It offers plenty of new ideas in five key sectors, from Home Decoration and Textiles to…

The homeware-consciuos crowd at Macef, Milan. Courtesy of Macef
45.469039
9.196114

38

Vogue Fashion Night Out

Sep 2010 (annual)

The world-renowned magazine Vogue launches a global celebration of fashion with evening extravaganzas in several fashion capitals, including Milan. The Fashion Quad, Milan’s fashion…

Armani store in Via Montenapoleone, Milan. Photo by Vito Arcomano, © Fototeca ENIT
45.479061
9.155645

39

Moda In

8 – 10 Sep 2010 (various dates)

Part of Milano Unica, Moda In is an international exhibition of textiles and accessories. Held twice a year at the Fieramilanocity, it ushers in the new fabrics and colours for the forthcoming season.

Modelling for Ferragamo at Moda In, Milan. Courtesy of Milano Unica
45.489021
9.29605

40

Idroscalo in Festa

Jun – Sep 2010 (annual)

Throughout the summer, Milan’s IdroPark, also known as Idroscalo and as Milan’s beach, hosts the Idroscalo in Festa initiative, encompassing music, theatre and sporting events. Expect some big…

Sunbathers at the IdroPark, Milan. Courtesy of IdroPark
45.4695
9.282216

41

Brocantage

10 – 12 Sep 2010 (various dates)

The quality-controlled Brocantage is an antiques fair at the Parco Esposizioni Novegro in Milan. It is full of interesting old things, and certainly worth browsing for those with a streak of…

Quality pieces displayed at Brocantage Antiques Fair. Courtesy of Parco Esposizioni Novregro
45.464442
9.189333

42

Celebration of the Holy Nail

Sep 2010 (annual)

During the Celebration of the Holy Nail, Milan’s archbishop ascends towards the ceiling of the Duomo in a rickety mechanical basket to bring down the relic to the crowd. It supposedly comes…

A view of the soaring spires of Milan Cathedral. Courtesy of Milan Tourist Office
45.466446
9.184642

43

Milan Film Festival

Sep 2010 (annual)

Held at the Piccolo Teatro, Parco Sempione and other venues, Milan’s annual film festival functions as a talent scout and a distributor in an alternative market. It attracts aspiring…

A view of Piccolo Teatro, Milan. Courtesy of Lombardia Spettacolo
45.477786
9.217294

44

Panoramica

Sep 2010 (annual)

Every year Panoramica screens a selection of films from the Venice and Locarno Film Festivals at the Anteo, Arcobaleno Filmcenter and Multisala Plinius cinemas in Milan. Around 50 productions…

Panoramica poster, Milan. Courtesy of Panoramica
45.535442
9.049228

45

International Cycle Expo

Sep 2010 (annual)

No-one with a passion for a two-wheeler should miss the International Cycle Expo at the Fiera Milano exhibition centre. Special events, including a bicycle tour, run alongside the main show.

Eicma Show District, Milan. Courtesy of Eicma
45.184364
9.497723

46

Fumettopoli

25 – 26 Sep 2010 (various dates)

With four annual editions at the Atahotel Executive, Fumettopoli is Milan’s most popular animation event. Collectors and aficionados congregate to complete their collections, swap, sell or buy…

QUIET PLEASE! Tom and Jerry’s Oscar winner in the category best cartoon USA 1945. Courtesy of the Mike Glad. collection, © Metro-Goldwyn-Mayer, Inc. / Turner Broadcast System Inc.
45.452333
9.176073

47

Antiques Market

26 Sep 2010 (monthly)

This Antiques Market stretches along the canal in Navigli for about two kilometres. Over 400 merchants set up stalls, while quality controls ensure merchandise is in good condition. Practise…

45.468929
9.181

48

MITO September Music

Sep 2010 (annual)

MITO September Music reinterprets classic and contemporary music in the light of multiculturalism. Held simultaneously in Milan and Turin, the festival features more than 200 events by famous…

Lorin Maazel. Courtesy of Settembre Musica
45.468929
9.181

49

European Heritage Days (Milan)

Sep 2010 (annual)

Originally a French initiative, today European Heritage Days is a huge event held in several European states to celebrate the continent’s artistic and cultural heritage. Milan joins in and…

Pinacoteca di Brera, Milan. Courtesy of IAT Ufficio Informazioni e Accoglienza Turistica Milano
45.479061
9.155645

50

Milano Pret-a-Porter

Sep 2010 (various dates)

Models shimmy down the catwalk at Fieramilanocity, revealing the latest hot trends for the coming season. With staple exhibitors like Versace, Armani and Dolce & Gabbana, Milano Pret-a-Porter…

Cheap Rent-A-Car

Encryption Using Rsa Algorithm in Java

Author: admin  //  Category: byte

Encryption using RSA algorithm in java

Introduction

In this article I will provide you an approach of using RSA algorithm for long String. As you know that RSA algorithm is limited 117 bytes, long strings can not be encrypted or decrypted. However it is possible to break the bytes into several chunks and then to encrypt or decrypt the contents. This algorithm is used for asymmetric cryptography. For asymmetric cryptography, you can click this link.

Technicalities

In this article I provide below the complete example for encryption and decryption of long strings. If you use the method of Cipher class ie.doFinal( byte[] bytesString), it will throw exception that it can be encrypted for more than 117 bytes for RSA.  But in the real application, you may not be sure about the length of the String you want to encrypt or decrypt. In this case you have to break the bytes and then to encrypt it. Please refer to the

Following complete example.

Complete example

Class name : SecurityUtil.java

package com.dds.core.security;

import java.security.KeyFactory;

import java.security.KeyPair;

import java.security.KeyPairGenerator;

import java.security.PrivateKey;

import java.security.PublicKey;

import java.security.Security;

import java.security.spec.EncodedKeySpec;

import java.security.spec.PKCS8EncodedKeySpec;

import java.security.spec.X509EncodedKeySpec;

import javax.crypto.Cipher;

import sun.misc.BASE64Decoder;

import sun.misc.BASE64Encoder;

import com.sun.crypto.provider.SunJCE;

/**This is a utility class which provides

* convenient method for security. This

* class provides the way where you can

* encrypt and decrypt the String having

* more than 117 bytes for RSA algorithm

* which is an asymmetric one.

* @author Debadatta Mishra(PIKU)

*

*/

public class SecurityUtil {

/**

* Object of type {@link KeyPair}

*/

private KeyPair keyPair;

/**

* String variable which denotes the algorithm

*/

private static final String ALGORITHM = “RSA”;

/**

* varibale for the keysize

*/

private static final int KEYSIZE = 1024;

/**

* Default constructor

*/

public SecurityUtil() {

super();

Security.addProvider(new SunJCE());

}

/**

* This method is used to generate

* the key pair.

*/

public void invokeKeys() {

try {

KeyPairGenerator keypairGenerator = KeyPairGenerator

.getInstance(ALGORITHM);

keypairGenerator.initialize(KEYSIZE);

keyPair = keypairGenerator.generateKeyPair();

} catch (Exception e) {

e.printStackTrace();

}

}

/**This method is used to obtain the String

* representation of the PublicKey.

* @param publicKey of type {@link PublicKey}

* @return PublicKey as a String

*/

public String getPublicKeyString(PublicKey publicKey) {

return new BASE64Encoder().encode(publicKey.getEncoded());

}

/**This method is used to obtain the String

* representation of the PrivateKey.

* @param privateKey of type {@link PrivateKey}

* @return PrivateKey as a String

*/

public String getPrivateKeyString(PrivateKey privateKey) {

return new BASE64Encoder().encode(privateKey.getEncoded());

}

/**This method is used to obtain the

* {@link PrivateKey} object from the

* String representation.

* @param key of type String

* @return {@link PrivateKey}

* @throws Exception

*/

public PrivateKey getPrivateKeyFromString(String key) throws Exception {

PrivateKey privateKey = null;

try {

KeyFactory keyFactory = KeyFactory.getInstance(ALGORITHM);

EncodedKeySpec privateKeySpec = new PKCS8EncodedKeySpec(

new BASE64Decoder().decodeBuffer(key));

privateKey = keyFactory.generatePrivate(privateKeySpec);

} catch (Exception e) {

e.printStackTrace();

}

return privateKey;

}

/**This method is used to obtain the {@link PublicKey}

* from the String representation of the Public Key.

* @param key of type String

* @return {@link PublicKey}

* @throws Exception

*/

public PublicKey getPublicKeyFromString(String key) throws Exception {

PublicKey publicKey = null;

try {

KeyFactory keyFactory = KeyFactory.getInstance(ALGORITHM);

EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(

new BASE64Decoder().decodeBuffer(key));

publicKey = keyFactory.generatePublic(publicKeySpec);

} catch (Exception e) {

e.printStackTrace();

}

return publicKey;

}

/**This method is used to obtain the

* encrypted contents from the original

* contents by passing the {@link PublicKey}.

* This method is useful when the byte is more

* than 117.

* @param text of type String

* @param key of type {@link PublicKey}

* @return encrypted value as a String

* @throws Exception

*/

public String getEncryptedValue(String text, PublicKey key)

throws Exception {

String encryptedText;

try {

byte[] textBytes = text.getBytes(“UTF8″);

Cipher cipher = Cipher.getInstance(“RSA/ECB/PKCS1Padding”);

cipher.init(Cipher.ENCRYPT_MODE, key);

int textBytesChunkLen = 100;

int encryptedChunkNum = (textBytes.length – 1) / textBytesChunkLen

+ 1;

// RSA returns 128 bytes as output for 100 text bytes

int encryptedBytesChunkLen = 128;

int encryptedBytesLen = encryptedChunkNum * encryptedBytesChunkLen;

System.out.println(“Encrypted bytes length——-”

+ encryptedBytesChunkLen);

// Define the Output array.

byte[] encryptedBytes = new byte[encryptedBytesLen];

int textBytesChunkIndex = 0;

int encryptedBytesChunkIndex = 0;

for (int i = 0; i

if (i

encryptedBytesChunkIndex = encryptedBytesChunkIndex

+ cipher.doFinal(textBytes, textBytesChunkIndex,

textBytesChunkLen, encryptedBytes,

encryptedBytesChunkIndex);

textBytesChunkIndex = textBytesChunkIndex

+ textBytesChunkLen;

} else {

cipher.doFinal(textBytes, textBytesChunkIndex,

textBytes.length – textBytesChunkIndex,

encryptedBytes, encryptedBytesChunkIndex);

}

}

encryptedText = new BASE64Encoder().encode(encryptedBytes);

} catch (Exception e) {

throw e;

}

return encryptedText;

}

/**This method is used to decrypt the contents.

* This method is useful when the size of the

* bytes is more than 117.

* @param text of type String indicating the

* encrypted contents.

* @param key of type {@link PrivateKey}

* @return decrypted value as a String

*/

public String getDecryptedValue(String text, PrivateKey key) {

String result = null;

try {

byte[] encryptedBytes = new BASE64Decoder().decodeBuffer(text);

Cipher cipher = Cipher.getInstance(“RSA/ECB/PKCS1Padding”);

cipher.init(Cipher.DECRYPT_MODE, key);

int encryptedByteChunkLen = 128;

int encryptedChunkNum = encryptedBytes.length

/ encryptedByteChunkLen;

int decryptedByteLen = encryptedChunkNum * encryptedByteChunkLen;

byte[] decryptedBytes = new byte[decryptedByteLen];

int decryptedIndex = 0;

int encryptedIndex = 0;

for (int i = 0; i

if (i

decryptedIndex = decryptedIndex

+ cipher.doFinal(encryptedBytes, encryptedIndex,

encryptedByteChunkLen, decryptedBytes,

decryptedIndex);

encryptedIndex = encryptedIndex + encryptedByteChunkLen;

} else {

decryptedIndex = decryptedIndex

+ cipher.doFinal(encryptedBytes, encryptedIndex,

encryptedBytes.length – encryptedIndex,

decryptedBytes, decryptedIndex);

}

}

result = new String(decryptedBytes).trim();

} catch (Exception e) {

e.printStackTrace();

}

return result;

}

/**This method is used obtain the

* {@link PublicKey}

* @return {@link PublicKey}

*/

public PublicKey getPublicKey() {

return keyPair.getPublic();

}

/**This method is used to obtain

* the {@link PrivateKey}

* @return {@link PrivateKey}

*/

public PrivateKey getPrivateKey() {

return keyPair.getPrivate();

}

}

The above class provides several useful methods for generation of Private key , Public Key and encryption of String and decryption of String.

Please refer to the following subordinate classes for the above class.

Class name : KeyGenerator.java

package com.dds.core.security;

import java.io.File;

import java.io.FileOutputStream;

import java.io.OutputStream;

import java.security.PrivateKey;

import java.security.PublicKey;

import java.util.Properties;

/**This class is used to generate the

* Private and Public key and stores

* them in files.

* @author Debadatta Mishra(PIKU)

*

*/

public class KeyGenerator {

/**This method is used to obtain the

* path of the keys directory where

* Private and Public key files are

* stored.

* @return path of the keys directory

*/

private static String getKeyFilePath() {

String keyDirPath = null;

try {

keyDirPath = System.getProperty(“user.dir”) + File.separator

+ “keys”;

File keyDir = new File(keyDirPath);

if (!keyDir.exists())

keyDir.mkdirs();

} catch (Exception e) {

e.printStackTrace();

}

return keyDirPath;

}

/**

* This method is used to generate the

* Private and Public keys.

*/

public static void generateKeys() {

Properties publicProp = new Properties();

Properties privateProp = new Properties();

try {

OutputStream pubOut = new FileOutputStream(getKeyFilePath()

+ File.separator + “public.key”);

OutputStream priOut = new FileOutputStream(getKeyFilePath()

+ File.separator + “private.key”);

SecurityUtil secureUtil = new SecurityUtil();

secureUtil.invokeKeys();

PublicKey publicKey = secureUtil.getPublicKey();

PrivateKey privateKey = secureUtil.getPrivateKey();

String publicString = secureUtil.getPublicKeyString(publicKey);

String privateString = secureUtil.getPrivateKeyString(privateKey);

publicProp.put(“key”, publicString);

publicProp.store(pubOut, “Public Key Info”);

privateProp.put(“key”, privateString);

privateProp.store(priOut, “Private Key Info”);

} catch (Exception e) {

e.printStackTrace();

}

}

}

The above class is used to generate the Public and Private keys. It generates and stores them in different files called Public.key and Private.key. Please refer the test harness class for the above class.

Class name: TestKeyGenerator

import com.dds.core.security.KeyGenerator;

/**This is a testharness class

* for the KeyGenerator class.

* @author Debadatta Mishra(PIKU)

*

*/

public class TestKeyGenerator {

public static void main(String[] args) {

KeyGenerator.generateKeys();

}

}

If you run the above class, you will find a directory called keys in your root path of your application folder. In this folder you will find two files one is for Private Key information and another is for Public Key.

There is another class which is used to obtain the Private key and Public key information stored in the files.

Class name: KeyReader.java

package com.dds.core.security;

import java.io.File;

import java.io.FileInputStream;

import java.io.InputStream;

import java.security.PublicKey;

import java.util.Properties;

/**This class is used to read the

* keys from the file.

* @author Debadatta Mishra(PIKU)

*

*/

public class KeyReader {

/**This method is used to obtain the

* string value of the Public Key

* from the file.

* @return String of {@link PublicKey}

*/

public static String getPublicKeyString() {

String publicString = null;

try {

Properties prop = new Properties();

String publicKeyPath = System.getProperty(“user.dir”)

+ File.separator + “keys” + File.separator + “public.key”;

InputStream in = new FileInputStream(publicKeyPath);

prop.load(in);

publicString = prop.getProperty(“key”);

} catch (Exception e) {

e.printStackTrace();

}

return publicString;

}

/**This method is used to obtain the

* String of Private Key from the file.

* @return String of private key

*/

public static String getPrivateKeyString() {

String publicString = null;

try {

Properties prop = new Properties();

String publicKeyPath = System.getProperty(“user.dir”)

+ File.separator + “keys” + File.separator + “private.key”;

InputStream in = new FileInputStream(publicKeyPath);

prop.load(in);

publicString = prop.getProperty(“key”);

} catch (Exception e) {

e.printStackTrace();

}

return publicString;

}

}

This is a utility class to read the Public and Private keys from the files.

Now refer to the test harness class which makes encryption and decryption of String.

import java.security.PrivateKey;

import java.security.PublicKey;

import com.dds.core.security.KeyReader;

import com.dds.core.security.SecurityUtil;

/**

* This is a test harness class for encryption and decryption.

*

* @author Debadatta Mishra(PIKU)

*

*/

public class TestEncryption {

public static void main(String[] args) {

String privateKeyString = KeyReader.getPrivateKeyString();

SecurityUtil securityUtil = new SecurityUtil();

String publicKeyString = KeyReader.getPublicKeyString();

try {

PublicKey publicKey = securityUtil

.getPublicKeyFromString(publicKeyString);

PrivateKey privateKey = securityUtil

.getPrivateKeyFromString(privateKeyString);

String originalValue = “provide some very long string”;

String encryptedValue = securityUtil.getEncryptedValue(

originalValue, publicKey);

System.out.println(“EncryptedValue—–” + encryptedValue);

String decryptedValue = securityUtil.getDecryptedValue(

encryptedValue, privateKey);

System.out.println(“Original Value——” + decryptedValue);

} catch (Exception e) {

e.printStackTrace();

}

}

}

This test harness class is used to encrypt and decrypt the long string contents. You can also use the same method for file encryption and decryption. First you have to read the contents of a file as String and then you can apply method to encrypt it.

Conclusion

I hope that you will enjoy my article for this asymmetric cryptography for RSA. 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

Incoming search terms:

Explaining Part P Courses – Where To Go

Author: admin  //  Category: electro house

Electrical energy plus the power market have a vital role throughout almost all of our everyday lives. We invariably must have competent electricians, for both domestic housing along with business. Essentially, electric employees are taken on to install, maintain as well as test related equipment and structures. The work is to a great extent dictated to by health and safety benchmarks. Throughout 2009, about 600,000 people were being employed in one sector or another of the UK’s electric industry. Using the suitable certification, you too could be savouring a lucrative, as well as fulfilling, electrical career.

In accordance with most of the trades-markets, good domestic electricians acquire a lot of their employment via word of mouth recommendations as a result of satisfied clientele. Therefore as well as appearing effective in your job, at all times be ethical along with friendly. Good manners genuinely do help make a significant impact.

Your retraining may normally include distance-learning tasks to complete in your own home, with the work-shops and examinations in-centre. Exactly how swiftly you work through any course would be down to yourself. You’re going to be placed for life if you become a accredited domestic electrician – why not pick up more info concerning instruction now?

One particular contributing factor many of us re-train to become domestic electrical engineers is certainly because they aspire to become self-employed. Without a doubt, it is fair to state that the vast majority of adult electrical trainees set off that way. On the grounds that the need for competent pro’s continues within domestic homes, this specific set up should be recommended. Lots of individuals train so they can possibly complete electro-mechanical work part-time, to earn extra salary. Still other people learn because it helps to save paying trades-people to complete their electro-mechanical jobs.

Exactly what sort of talents can electricians want? To be an electrician you will want to be competent to utilize a variety of tools successfully. It’s important to be qualified to follow safety specifications and procedures, therefore you should have the ability to perform assignments with incredible precision. Seeing as plenty of your work might be unaccompanied, you must be satisfied to deliver the results all on your own. Your sense of balance must be good, in conjunction with your color vision and also general level of fitness. And ultimately, everyone trying to start off their very own business must remain focused as well as determined.

The particular professional trade bodies which offer the foremost regarded certifications are EAL along with City & Guilds. Nearly all younger men and women joining this trade, straight from school, will work for City & Guilds qualifications, on top of corresponding NVQ’s/SVQ’s. Over-all, this stretches out education to thirty six – 48 months. Adults over the age of about 30 will largely study reduced courses part-time, a lot of this in the comfort of your own home. As a lot of them usually are getting ready for projects within domestic houses as an alternative to industry, they won’t need NVQs. Adult career-changers expect the best value for money, along with more flexibility. Enrolees emerge with secure, trade-eligible electrician skills that they could quickly start to use inside homes everywhere.

Even though study course contents may vary a bit, just about every level 2 EAL Domestic Installer study course ought to adopt a validated track. Education should embody all the cabling basics and safety strategies. You will be geared up to get the European union Building Regulations certification – referred to as Part P. Every practising electrical installer should also gain the C&G 2382 17th Edition IEE Cabling Reg’s Credential, consequently preparation should be integrated for that also. Focusing in the direction of these kinds of industry-accepted skills would certainly ready you not merely to labor upon projects in kitchens and bathrooms, with lighting circuits and wall sockets etc., but additionally so that you can self-certify them also.

Some of the domestic electrical engineers used by bigger corporations do shifts, but most do a regular nine hr day through the working week. For that, they should typically get given around 26k a year. On the flip side, home electro-mechanical installers employed by themselves might pull in a great deal more, though they may also have to put in much more adaptable days. To become self-employed additionally means that there can be overheads to take into consideration, accordingly prices will need to echo this.

Incoming search terms: