|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object core.crypto.Symmetric
public class Symmetric
A static class Providing all symmetric cipher Operations
Copyright (c) 2006 Sebastian Erdweg Copyright (c) 2006 Dominik Schulz Copyright (c) 2006 Florian Lindner Copyright (c) 2006 Betim Berjani This file is part of FlexiCrypt. FlexiCrypt is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. FlexiCrypt is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FlexiCrypt; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Field Summary | |
---|---|
static String |
SECRET_KEY_END_TAG
|
static String |
SECRET_KEY_START_TAG
|
Method Summary | |
---|---|
static byte[] |
decrypt(byte[] in,
SecretKey secretKey,
int buffersize)
|
static void |
decrypt(File inputFile,
File outputFile,
SecretKey secretKey,
int buffersize)
|
static void |
decrypt(InputStream fis,
OutputStream fos,
SecretKey secretKey,
int buffersize)
|
static String |
decrypt(String in,
SecretKey secretKey,
int buffersize)
|
static byte[] |
encrypt(byte[] in,
SecretKey secretKey,
int buffersize)
|
static void |
encrypt(File inputFile,
File outputFile,
SecretKey secretKey,
int buffersize)
|
static void |
encrypt(InputStream fis,
OutputStream fos,
SecretKey secretKey,
int buffersize)
|
static String |
encrypt(String in,
SecretKey secretKey,
int buffersize)
|
static SecretKey |
getNewKey(String algorithm,
int keySize)
Erzeugt einen neuen symmetrischen Schlüssel |
static SecretKey |
getNewPBEKey(char[] password)
Constructs a passphrase based encryption key by computing its hashvalue 5 times with MD5 and then creating an RC6 key out of it. |
static HashMap<String,Set<Integer>> |
getValidServices()
Creates a set of valid symmetric algorithms |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String SECRET_KEY_START_TAG
public static final String SECRET_KEY_END_TAG
Method Detail |
---|
public static byte[] decrypt(byte[] in, SecretKey secretKey, int buffersize) throws InvalidKeyException, NoSuchPaddingException, NoSuchAlgorithmException, IOException, InterruptedException
in
- secretKey
- buffersize
-
InvalidKeyException
NoSuchPaddingException
NoSuchAlgorithmException
IOException
InterruptedException
public static String decrypt(String in, SecretKey secretKey, int buffersize) throws InvalidKeyException, NoSuchPaddingException, NoSuchAlgorithmException, IOException, InterruptedException
in
- secretKey
- buffersize
-
InvalidKeyException
NoSuchPaddingException
NoSuchAlgorithmException
IOException
InterruptedException
public static void decrypt(File inputFile, File outputFile, SecretKey secretKey, int buffersize) throws FileNotFoundException, NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, IOException, InterruptedException
inputFile
- outputFile
- secretKey
- buffersize
-
FileNotFoundException
NoSuchPaddingException
NoSuchAlgorithmException
InvalidKeyException
IOException
InterruptedException
public static void decrypt(InputStream fis, OutputStream fos, SecretKey secretKey, int buffersize) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, IOException, InterruptedException
fis
- fos
- secretKey
- buffersize
-
NoSuchPaddingException
NoSuchAlgorithmException
InvalidKeyException
IOException
InterruptedException
public static byte[] encrypt(byte[] in, SecretKey secretKey, int buffersize) throws InvalidKeyException, NoSuchPaddingException, NoSuchAlgorithmException, IOException, InterruptedException
in
- secretKey
- buffersize
-
InvalidKeyException
NoSuchPaddingException
NoSuchAlgorithmException
IOException
InterruptedException
public static String encrypt(String in, SecretKey secretKey, int buffersize) throws InvalidKeyException, NoSuchPaddingException, NoSuchAlgorithmException, IOException, InterruptedException
InvalidKeyException
NoSuchPaddingException
NoSuchAlgorithmException
IOException
InterruptedException
public static void encrypt(File inputFile, File outputFile, SecretKey secretKey, int buffersize) throws FileNotFoundException, NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, IOException, InterruptedException
inputFile
- outputFile
- secretKey
- buffersize
-
FileNotFoundException
NoSuchPaddingException
NoSuchAlgorithmException
InvalidKeyException
IOException
- Encryption using Files
InterruptedException
public static void encrypt(InputStream fis, OutputStream fos, SecretKey secretKey, int buffersize) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, IOException, InterruptedException
fis
- - The FileInputStream containing the encrypted datafos
- - The FileOutputStrem to write the decrypted datasecretKey
- - The secret key (shared secret) used to encrypt the databuffersize
-
InterruptedException
BadPaddingException
IllegalBlockSizeException
NoSuchPaddingException
NoSuchAlgorithmException
InvalidKeyException
IOException
public static SecretKey getNewKey(String algorithm, int keySize) throws NoSuchAlgorithmException
algorithm
- keySize
-
NoSuchAlgorithmException
public static SecretKey getNewPBEKey(char[] password) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException, InterruptedException, IOException
password
-
NoSuchAlgorithmException
IOException
InterruptedException
InvalidAlgorithmParameterException
public static HashMap<String,Set<Integer>> getValidServices()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |