javi
Class Vigenere

public class Vigenere

Title: JaVi BO

Description: La classe contenente l'algoritmo di Vigenere per cifrare e decifrare
The class containing the Vigenere algorithm to encrypt and decrypt

Copyright: Copyright (c) 2002 Pierre Blanc

Company: Teutoburgo

Version:
1.0
Author:
Pierre Blanc
Method Detail

getEncryptedPhrase

public String getEncryptedPhrase(String phrase,
                                 String key)
Il metodo getEncryptedPhrase serve per cifrare la frase in chiaro (String phrase) attraverso la chiave (String key).
The method getEncryptedPhrase is to encrypt the phrase (String phrase) using the key (String key).
Parameters:
phrase - The phrase to be encrypted
key - The key for the algorithm
Returns:
The encrypted phrase

getPhrase

public String getPhrase(String cryptedPhrase,
                        String key)
Il metodo getPhrase serve per ottenere la frase in chiaro avendo la frase cifrata (String cryptedPhrase) e la stessa chiave usata per cifrare (String key)
The method getPhrase is to get the phrase using the encrypted phrase (String encryptedPhrase) and the same key used to encrypt (String key)
Parameters:
cryptedPhrase - the encrypted phrase
key - the key
Returns:
the plain text phrase

getKSPerCent

public int getKSPerCent(String key,
                        int accur)
Prende il double restituito da getKeyStrength e lo converte in un int tra 0 e 100 per dare la percentuale di forza
Converts the double returned by getKeyStrength into an int from 0 to 100 to give the strength in percent
Parameters:
key - the key
accur - the accuracy. The more is big, the more JaVi is slow.
Returns:
the key strength from 0 to 100.

getKeyStrength

public double getKeyStrength(String key,
                             int accur)
Restituisce un double tra 0 e 1 per valutare la forza della chiave. Prende la chiave key, l'accuratezza accur (0 è il massimo della forza, 1 è la forza peggiore)
Returns a double from 0 to 1 to evalue the strength of the key. The parameters are the key key, the accuracy accur (0 is the maximum strength, 1 is the minimum strength)
Parameters:
key - the key
accur - the accuracy
Returns:
a double from 0 to 1

maxKeyStrength

public double maxKeyStrength(String key,
                             double[] dD,
                             int dM)
nel maxKeyStrength viene considerata unicamente la forza peggiore, ovvero la massima (1 è la peggiore, 0 la migliore in assoluto)
in maxKeyStrength it is considered only the worst strength, i.e. the maximum (1 is the worst, 0 the best)
Parameters:
key - the key
dD - an array containing the strengths for the levels 1,2,...,dM
dM - the accuracy
Returns:
a double from 0 to 1

averageKeyStrength

public double averageKeyStrength(String key,
                                 double[] dD,
                                 int dM)
nell'average viene restituita la forza media averageKeyStrength returns the average Strength
Parameters:
key - the key
dD - an array containing the strengths for the levels 1,2,...,dM
dM - the accuracy
Returns:
a double from 0 to 1

trovaStringhe

public Vector trovaStringhe(String key,
                            int k,
                            int q)
il metodo restituisce un Vector di oggetti FrequenzaNijk
returns a Vector of objects FrequenzaNijk
Parameters:
key - the key
k - the depth level (length of the String)
q - the symbols in the alphabet (UnicZ-Unic0)
Returns:
a Vector containing FrequenzaNijk objects