|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmain.DNACrypt
public class DNACrypt
Constructor Summary | |
---|---|
DNACrypt()
Creates an instance of DNACrypt |
Method Summary | |
---|---|
char[] |
binaryCrypt(byte[] file,
ForeignKey key,
int correction)
Encrypts the inputfile by using the binary encryption |
byte[] |
binaryDecrypt(char[] genome,
ForeignKey key,
boolean inGenome,
int correction)
Decrypts a genome by using the binary decryption |
char[] |
clellandCrypt(char[] text)
Encrypts a text by using the Clelland method |
char[] |
clellandDecrypt(char[] genome,
boolean inGenome)
Decrypts a genome by using the Clelland method |
java.util.Properties |
defaultProperties()
Sets Default Properties |
void |
deleteKey(java.lang.String name,
java.lang.String type,
java.lang.String date)
Deletes a key |
boolean |
existUser(java.lang.String login)
|
void |
exit()
Exiting DNACrypt |
void |
exportKey(java.lang.String name,
java.lang.String type,
java.lang.String date,
java.io.File file)
Exports a key to the file system |
User |
findUser(java.lang.String login)
Finds a User by login |
boolean |
getbinaryFlag()
|
char[] |
getGenome()
|
byte[] |
getInputfile()
|
ForeignKey |
getKey(java.lang.String name,
java.lang.String type,
java.lang.String date)
|
java.util.ArrayList<ForeignKey> |
getKeyListe()
|
java.util.Properties |
getProperties()
|
User |
getUser()
|
void |
importKey(java.io.File file)
Imports a key from the file system |
void |
loadFile(java.io.File file)
Loads a file |
void |
loadGenome(java.io.File file)
Loads a genome |
OneTimePad |
loadOneTimePad(java.io.File file)
Loads a One Time Pad |
java.util.Properties |
loadProperties()
Loads the Property file |
UserManager |
loadUserVerwaltung()
Loads the UserManager |
void |
loginUser(User user)
Sets the current User to the given one |
void |
logoutUser()
Logs out the current User |
void |
newKey(int keytype)
Creates a new key |
void |
newUser(java.lang.String name,
java.lang.String surname,
java.lang.String login,
java.lang.String passwort)
Creates a new User |
char[] |
otpCrypt(int correction)
Encrypts the inputfile by using a One Time Pad |
byte[] |
otpDecrypt(OneTimePad otp,
char[] genome,
boolean inGenome,
int correction)
Decrypts a genome by using a One Time Pad |
char[] |
reverse(char[] genome)
Reverse transcribes a RNA sequence to DNA sequence |
void |
saveFile(java.lang.String file,
java.lang.Object obj)
Saves a file |
void |
saveOutput(java.io.File file)
Saves the output to file system |
void |
saveOutput(java.io.File file,
java.lang.String output)
Saves the output to file system |
void |
setBinaryFlag(boolean setting)
|
void |
setGenome(char[] genome)
|
void |
setInputfile(byte[] inputfile)
|
void |
setOutputfile(byte[] outputfile)
|
void |
setUser(java.lang.String name,
java.lang.String surname,
java.lang.String passwort)
Sets the attributes of the current User |
char[] |
transcribe(char[] genome)
Transcribes a DNA sequence |
char[] |
translate(char[] genome)
Translated a RNA sequence to a protein sequence |
void |
updateProperties(java.lang.String text00,
java.lang.String text01,
java.lang.String text10,
java.lang.String text11,
java.lang.String textFILE,
java.lang.String textGENOME,
java.lang.String WDH_CONSTANT)
Updates the properties |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DNACrypt()
Method Detail |
---|
public java.util.Properties defaultProperties()
public java.util.Properties loadProperties()
public void saveFile(java.lang.String file, java.lang.Object obj)
file
- the target fileobj
- the Object to savepublic void newUser(java.lang.String name, java.lang.String surname, java.lang.String login, java.lang.String passwort)
name
- the name of the usersurname
- the surname of the userlogin
- the login of the userpasswort
- the password of the userpublic void loginUser(User user)
user
- the current Userpublic boolean existUser(java.lang.String login)
login
- the login of the User
public User findUser(java.lang.String login)
login
- the login of the User
public void setUser(java.lang.String name, java.lang.String surname, java.lang.String passwort)
name
- the new name of the Usersurname
- the new surname of the Userpasswort
- the new Password of the Userpublic UserManager loadUserVerwaltung()
public OneTimePad loadOneTimePad(java.io.File file)
file
- the source file
public void exit()
public void saveOutput(java.io.File file, java.lang.String output)
file
- the target filethe
- output to savepublic void saveOutput(java.io.File file)
file
- the target filepublic void loadFile(java.io.File file)
file
- the source filepublic void loadGenome(java.io.File file)
file
- the source filepublic byte[] getInputfile()
public void setInputfile(byte[] inputfile)
inputfile
- The inputfile to set.public User getUser()
public void logoutUser()
public char[] getGenome()
public void setGenome(char[] genome)
genome
- The genome to set.public char[] transcribe(char[] genome)
genome
- the DNA sequence
public char[] translate(char[] genome)
genome
- the RNA sequence
public char[] reverse(char[] genome)
genome
- the RNA sequence
public char[] clellandCrypt(char[] text) throws java.lang.Exception
text
- the text to encode
java.lang.Exception
public char[] otpCrypt(int correction) throws java.lang.Exception
java.lang.Exception
public char[] binaryCrypt(byte[] file, ForeignKey key, int correction) throws java.lang.Exception
file
- the file to encodekey
- the key for encryption or null
java.lang.Exception
public char[] clellandDecrypt(char[] genome, boolean inGenome) throws java.lang.Exception
genome
- the genome to decodeinGenome
- true, if the text was encoded in a genome, otherwise false
java.lang.Exception
public byte[] otpDecrypt(OneTimePad otp, char[] genome, boolean inGenome, int correction) throws java.lang.Exception
otp
- the One Time Padgenome
- the genome to decodeinGenome
- true, if the text was encoded in a genome, otherwise false
java.lang.Exception
public byte[] binaryDecrypt(char[] genome, ForeignKey key, boolean inGenome, int correction) throws java.lang.Exception
genome
- the genome to decodekey
- the key for decryption or nullinGenome
- true, if the text was encoded in a genome, otherwise false
java.lang.Exception
public void setOutputfile(byte[] outputfile)
outputfile
- The outputfile to set.public void setBinaryFlag(boolean setting)
setting
- public boolean getbinaryFlag()
public void exportKey(java.lang.String name, java.lang.String type, java.lang.String date, java.io.File file)
name
- the name of the ownertype
- the type of the keydate
- the time of creationfile
- the target filepublic void importKey(java.io.File file) throws java.lang.Exception
file
- the source file
java.lang.Exception
public ForeignKey getKey(java.lang.String name, java.lang.String type, java.lang.String date)
name
- the name of the ownertype
- the type of the keydate
- the time of creation
public void newKey(int keytype)
keytype
- the type of the new keypublic java.util.ArrayList<ForeignKey> getKeyListe()
public void deleteKey(java.lang.String name, java.lang.String type, java.lang.String date)
name
- the name of the ownertype
- the type of the keydate
- the time of creationpublic java.util.Properties getProperties()
public void updateProperties(java.lang.String text00, java.lang.String text01, java.lang.String text10, java.lang.String text11, java.lang.String textFILE, java.lang.String textGENOME, java.lang.String WDH_CONSTANT)
text00
- the binary encryption for "00"text01
- the binary encryption for "01"text10
- the binary encryption for "10"text11
- the binary encryption for "11"
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |