KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > schlichtherle > crypto > io > raes > RAES


1 /*
2  * Copyright 2005-2006 Schlichtherle IT Services
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package de.schlichtherle.crypto.io.raes;
18
19 /**
20  * This interfaces contains constants used to read or write files
21  * according to the Random Access Encryption Specification (RAES).
22  *
23  * @author Christian Schlichtherle
24  * @version @version@
25  * @since TrueZIP 6.0
26  */

27 interface RAES {
28
29     /**
30      * The signature of any RAES compatible content in little endian format
31      * (<tt>"RAES"</tt> as a US-ASCII character sequence).
32      */

33     int RAES_SIGNATURE = 'R' | (('A' | (('E' | ('S' << 8)) << 8)) << 8);
34     
35     int LEAD_IN_LENGTH =
36             4 + // RAES_SIGNATURE
37
1; // Envelope type
38

39     /**
40      * The data envelope type used for password based encryption
41      * with the same salt length as the cipher key length.
42      */

43     byte ENVELOPE_TYPE_0 = 0;
44
45     /** The length of the header before the salt and the encrypted data. */
46     int ENVELOPE_TYPE_0_HEADER_LEN_WO_SALT =
47             LEAD_IN_LENGTH +
48             1 + // Cipher and MAC key strength.
49
2; // Iteration count
50
// The salt which's length is the cipher key length.
51
// The ciphered data which has the same length as the plain data.
52
// The KLAC (first half of 256 bit SHA output = 128 bits).
53
// The MAC (first half of 256 bit SHA output = 128 bits).
54

55     /**
56      * The data envelope type reserved for certificate based encryption and
57      * authentication.
58      * This type is not yet specified, but reserved for future use.
59      */

60     byte ENVELOPE_TYPE_1 = 1;
61     
62     /**
63      * The block size of the Advanced Encryption Specification (AES) Algorithm
64      * in bits (<tt>128</tt>).
65      */

66     int AES_BLOCK_SIZE = 128;
67 }
68
Popular Tags