3232# file-based implementations, that some files may need to be read-write as they
3333# get updated dynamically.
3434#
35- # Before using, be sure to update the MasterKey and MasterSalt as described below.
36- # N.B.: If you had stored data that you have previously encrypted with ESAPI 1.4,
37- # you *must* FIRST decrypt it using ESAPI 1.4 and then (if so desired)
38- # re-encrypt it with ESAPI 2.0. If you fail to do this, you will NOT be
39- # able to decrypt your data with ESAPI 2.0.
40- #
41- # YOU HAVE BEEN WARNED!!! More details are in the ESAPI 2.0 Release Notes.
42- #
4335# ===========================================================================
4436# ESAPI Configuration
4537#
@@ -133,21 +125,6 @@ Encoder.DefaultCodecList=HTMLEntityCodec,PercentCodec,JavaScriptCodec
133125# unlimited strength policy files and install in the lib directory of your JRE/JDK.
134126# See http://java.sun.com/javase/downloads/index.jsp for more information.
135127#
136- # Backward compatibility with ESAPI Java 1.4 is supported by the two deprecated API
137- # methods, Encryptor.encrypt(String) and Encryptor.decrypt(String). However, whenever
138- # possible, these methods should be avoided as they use ECB cipher mode, which in almost
139- # all circumstances a poor choice because of it's weakness. CBC cipher mode is the default
140- # for the new Encryptor encrypt / decrypt methods for ESAPI Java 2.0. In general, you
141- # should only use this compatibility setting if you have persistent data encrypted with
142- # version 1.4 and even then, you should ONLY set this compatibility mode UNTIL
143- # you have decrypted all of your old encrypted data and then re-encrypted it with
144- # ESAPI 2.0 using CBC mode. If you have some reason to mix the deprecated 1.4 mode
145- # with the new 2.0 methods, make sure that you use the same cipher algorithm for both
146- # (256-bit AES was the default for 1.4; 128-bit is the default for 2.0; see below for
147- # more details.) Otherwise, you will have to use the new 2.0 encrypt / decrypt methods
148- # where you can specify a SecretKey. (Note that if you are using the 256-bit AES,
149- # that requires downloading the special jurisdiction policy files mentioned above.)
150- #
151128# ***** IMPORTANT: Do NOT forget to replace these with your own values! *****
152129# To calculate these values, you can run:
153130# java -classpath esapi.jar org.owasp.esapi.reference.crypto.JavaEncryptor
@@ -185,12 +162,6 @@ Encryptor.PreferredJCEProvider=
185162
186163# AES is the most widely used and strongest encryption algorithm. This
187164# should agree with your Encryptor.CipherTransformation property.
188- # By default, ESAPI Java 1.4 uses "PBEWithMD5AndDES" and which is
189- # very weak. It is essentially a password-based encryption key, hashed
190- # with MD5 around 1K times and then encrypted with the weak DES algorithm
191- # (56-bits) using ECB mode and an unspecified padding (it is
192- # JCE provider specific, but most likely "NoPadding"). However, 2.0 uses
193- # "AES/CBC/PKCSPadding". If you want to change these, change them here.
194165# Warning: This property does not control the default reference implementation for
195166# ESAPI 2.0 using JavaEncryptor. Also, this property will be dropped
196167# in the future.
@@ -228,17 +199,29 @@ Encryptor.cipher_modes.combined_modes=GCM,CCM,IAPM,EAX,OCB,CWC
228199# DISCUSS: Better name?
229200Encryptor.cipher_modes.additional_allowed =CBC
230201
231- # 128-bit is almost always sufficient and appears to be more resistant to
232- # related key attacks than is 256-bit AES. Use '_' to use default key size
233- # for cipher algorithms (where it makes sense because the algorithm supports
234- # a variable key size). Key length must agree to what's provided as the
235- # cipher transformation, otherwise this will be ignored after logging a
236- # warning.
202+ # Default key size to use for cipher specified by Encryptor.EncryptionAlgorithm.
203+ # Note that this MUST be a valid key size for the algorithm being used
204+ # (as specified by Encryptor.EncryptionAlgorithm). So for example, if AES is used,
205+ # it must be 128, 192, or 256. If DESede is chosen, then it must be either 112 or 168.
206+ #
207+ # Note that 128-bits is almost always sufficient and for AES it appears to be more
208+ # somewhat more resistant to related key attacks than is 256-bit AES.)
209+ #
210+ # Defaults to 128-bits if left blank.
211+ #
212+ # NOTE: If you use a key size > 128-bits, then you MUST have the JCE Unlimited
213+ # Strength Jurisdiction Policy files installed!!!
237214#
238- # NOTE: This is what applies BOTH ESAPI 1.4 and 2.0. See warning above about mixing!
239215Encryptor.EncryptionKeyLength =128
240216
241- # Because 2.0 uses CBC mode by default, it requires an initialization vector (IV).
217+ # This is the _minimum_ key size (in bits) that we allow with ANY symmetric
218+ # cipher for doing encryption. (There is no minimum for decryption.)
219+ #
220+ # Generally, if you only use one algorithm, this should be set the same as
221+ # the Encryptor.EncryptionKeyLength property.
222+ Encryptor.MinEncryptionKeyLength =128
223+
224+ # Because 2.x uses CBC mode by default, it requires an initialization vector (IV).
242225# (All cipher modes except ECB require an IV.) There are two choices: we can either
243226# use a fixed IV known to both parties or allow ESAPI to choose a random IV. While
244227# the IV does not need to be hidden from adversaries, it is important that the
@@ -249,8 +232,12 @@ Encryptor.EncryptionKeyLength=128
249232# IVs. If you wish to use 'fixed' IVs, set 'Encryptor.ChooseIVMethod=fixed' and
250233# uncomment the Encryptor.fixedIV.
251234#
252- # Valid values: random|fixed|specified 'specified' not yet implemented; planned for 2.1
235+ # Valid values: random|fixed|specified 'specified' not yet implemented; planned for 2.3
236+ # 'fixed' is deprecated as of 2.2
237+ # and will be removed in 2.3.
253238Encryptor.ChooseIVMethod =random
239+
240+
254241# If you choose to use a fixed IV, then you must place a fixed IV here that
255242# is known to all others who are sharing your secret key. The format should
256243# be a hex string that is the same length as the cipher block size for the
@@ -260,6 +247,10 @@ Encryptor.ChooseIVMethod=random
260247# "Recommendation for Block Cipher Modes of Operation".
261248# (Note that the block size for AES is 16 bytes == 128 bits.)
262249#
250+ # @Deprecated -- fixed IVs are deprecated as of the 2.2 release and support
251+ # will be removed in the next release (tentatively, 2.3).
252+ # If you MUST use this, at least replace this IV with one
253+ # that your legacy application was using.
263254Encryptor.fixedIV =0x000102030405060708090a0b0c0d0e0f
264255
265256# Whether or not CipherText should use a message authentication code (MAC) with it.
@@ -270,7 +261,15 @@ Encryptor.fixedIV=0x000102030405060708090a0b0c0d0e0f
270261# "combined mode" cipher mode.
271262#
272263# If you are using ESAPI with a FIPS 140-2 cryptographic module, you *must* also
273- # set this property to false.
264+ # set this property to false. That is because ESAPI takes the master key and
265+ # derives 2 keys from it--a key for the MAC and a key for encryption--and
266+ # because ESAPI is not itself FIPS 140-2 verified such intermediary aterations
267+ # to keys from FIPS approved sources would have the effect of making your FIPS
268+ # approved key generation and thus your FIPS approved JCE provider unapproved!
269+ # More details in
270+ # documentation/esapi4java-core-2.0-readme-crypto-changes.html
271+ # documentation/esapi4java-core-2.0-symmetric-crypto-user-guide.html
272+ # You have been warned.
274273Encryptor.CipherText.useMAC =true
275274
276275# Whether or not the PlainText object may be overwritten and then marked
@@ -279,12 +278,14 @@ Encryptor.PlainText.overwrite=true
279278
280279# Do not use DES except in a legacy situations. 56-bit is way too small key size.
281280# Encryptor.EncryptionKeyLength=56
281+ # Encryptor.MinEncryptionKeyLength=56
282282# Encryptor.EncryptionAlgorithm=DES
283283
284284# TripleDES is considered strong enough for most purposes.
285285# Note: There is also a 112-bit version of DESede. Using the 168-bit version
286286# requires downloading the special jurisdiction policy from Sun.
287287# Encryptor.EncryptionKeyLength=168
288+ # Encryptor.MinEncryptionKeyLength=112
288289# Encryptor.EncryptionAlgorithm=DESede
289290
290291Encryptor.HashAlgorithm =SHA-512
0 commit comments