Skip to content

Commit 2671692

Browse files
authored
Merge pull request ESAPI#487 from kwwall/master
Master branch updates for ESAPI-2.2.0.0-RC2
2 parents a93c6d8 + 7091145 commit 2671692

File tree

89 files changed

+2000
-1753
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+2000
-1753
lines changed

CONTRIBUTING-TO-ESAPI.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ Steps to work with ESAPI:
6969
forked repo created in previous step)
7070
3. Create a new branch to work on an issue. I usually name the branch
7171
'issue-#' where '#' is the GitHub issue # is will be working on, but
72-
you can call it whatever.
72+
you can call it whatever. E.g.,
73+
git checkout -b issue-#
7374
4. Work on the GitHub issue on this newly created issue-# branch.
7475
5. Make sure everything builds correctly and all the JUnit tests pass
7576
('mvn test'). [Note: On occasion, there may be a failure in

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ When reporting an issue, please be clear and try to ensure that the ESAPI develo
4242
### Find an Issue?
4343
If you have found a bug, then create an issue on the esapi-legacy-java repo: https://github.com/ESAPI/esapi-java-legacy/issues
4444

45-
NOTE: Please do NOT use GitHub issues to ask questions about ESAPI. If you wish to do this, post to either of the 2 mailing lists found at the bottom of this page. If we find questions as GitHub issues, we simply will close them and direct you to do this anyhow.
45+
NOTE: Please do NOT use GitHub issues to ask questions about ESAPI. If you wish to do this, post to either of the 2 mailing lists (now on Google Groups) found at the bottom of this page. If we find questions as GitHub issues, we simply will close them and direct you to do this anyhow.
4646

4747
### Find a Vulnerability?
4848
If you have found a vulnerability in ESAPI legacy, first search the issues list (see above) to see if it has already been reported. If it has not, then please contact both Kevin W. Wall (kevin.w.wall at gmail.com) and Matt Seil (matt.seil at owasp.org) directly. Please do not report vulnerabilities via GitHub issues or via the ESAPI mailing lists as we wish to keep our users secure while a patch is implemented and deployed. If you wish to be acknowledged for finding the vulnerability, then please follow this process. (Eventually, we would like to have BugCrowd handle this, but that's still a ways off.) Also, when you post the email describing the vulnerability, please do so from an email address that you usually monitor.
@@ -64,5 +64,12 @@ Channel: #esapi<br/>
6464
Webchat http://webchat.freenode.net/
6565

6666
*Mailing lists:*
67-
[ESAPI-Users mailing list](https://lists.owasp.org/mailman/listinfo/esapi-user/) and
68-
[ESAPI-Developers mailing list](https://lists.owasp.org/mailman/listinfo/esapi-dev/)
67+
As of 2019-03-25, ESAPI's 2 mailing lists were officially moved OFF of their Mailman mailing lists to a new home on Google Groups.
68+
69+
The names of the 2 Google Groups are "[esapi-project-users](mailto:[email protected])" and "[esapi-project-dev](mailto:[email protected])", which you may POST to after you subscribe to them via "[Subscribe to ESAPI Users list](https://groups.google.com/forum/#!forum/esapi-project-users/join)" and "[Subscribe to ESAPI Developers list](https://groups.google.com/forum/#!forum/esapi-project-dev/join)" respectively.
70+
71+
Old archives for the old Mailman mailing lists for ESAPI-Users and ESAPI-Dev are still available at https://lists.owasp.org/pipermail/esapi-users/ and https://lists.owasp.org/pipermail/esapi-dev/ respectively.
72+
73+
For a general overview of Google Groups and its web interface, see https://groups.google.com/forum/#!overview
74+
75+
For assistance subscribing and unsubscribing to Google Groups, see https://webapps.stackexchange.com/questions/13508/how-can-i-subscribe-to-a-google-mailing-list-with-a-non-google-e-mail-address/15593#15593

configuration/esapi/ESAPI.properties

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@
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?
229200
Encryptor.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!
239215
Encryptor.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.
253238
Encryptor.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.
263254
Encryptor.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.
274273
Encryptor.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

290291
Encryptor.HashAlgorithm=SHA-512

documentation/esapi4java-core-2.0-symmetric-crypto-user-guide.html

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<HTML>
33
<HEAD>
44
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
5-
<TITLE>ESAPI 2.0 Symmetric Encryption User Guide</TITLE>
5+
<TITLE>ESAPI 2.x Symmetric Encryption User Guide</TITLE>
66
<META NAME="GENERATOR" CONTENT="OpenOffice.org 3.0 (Linux)">
77
<META NAME="CREATED" CONTENT="20100214;0">
88
<META NAME="CHANGEDBY" CONTENT="Kevin W. Wall">
@@ -12,17 +12,9 @@
1212
<TABLE BORDER="0" BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0 STYLE="page-break-before: auto; page-break-after: auto; page-break-inside: auto">
1313
<TR>
1414
<TD>
15-
<OBJECT TYPE="audio/x-mpeg" data="http://www.catonmat.net/download/crypt-o.mp3"
16-
WIDTH="500" HEIGHT="64" AUTOPLAY="false">
17-
<PARAM NAME="src" VALUE="http://www.catonmat.net/download/crypt-o.mp3" />
18-
<PARAM NAME="controller" VALUE="true" />
19-
<PARAM NAME="autoplay" VALUE="false" />
20-
<PARAM NAME="autostart" VALUE="0" />
21-
</OBJECT>
22-
</TD>
23-
<TD>
2415
<FONT COLOR="#00a444" SIZE="+2">
25-
<I>Crypto song. Take a listen and enjoy! Harry Belafonte never sounded this good. ;-)</I>
16+
<A HREF="http://www.catonmat.net/download/crypt-o.mp3" TARGET="_blank"i
17+
REL="noopener noreferrer nofollow">Crypto song</A>: <I>Take a listen and enjoy! Harry Belafonte never sounded this good. ;-)</I>
2618
</FONT>
2719
</TD>
2820
</TABLE>
@@ -121,10 +113,29 @@ <H2>ESAPI.properties Properties Relevant to Symmetric Encryption</H2>
121113
<PRE><FONT COLOR="#ff0000"><FONT SIZE=2>128</FONT></FONT></PRE>
122114
</TD>
123115
<TD WIDTH=226>
124-
<P><FONT SIZE=2>Key size, in bits. Required for cipher algorithms
116+
<P><FONT SIZE=2>Default key size, in bits. Required for cipher algorithms
125117
that support multiple key sizes.</FONT></P>
126118
</TD>
127119
</TR>
120+
<TR VALIGN=TOP>
121+
<TD WIDTH=249>
122+
<PRE><FONT COLOR="#ff0000"><FONT SIZE=2>Encryptor.MinEncryptionKeyLength</FONT></FONT></PRE>
123+
</TD>
124+
<TD WIDTH=202>
125+
<PRE><FONT COLOR="#ff0000"><FONT SIZE=2>128</FONT></FONT></PRE>
126+
</TD>
127+
<TD WIDTH=226>
128+
<P><FONT SIZE=2>Minimum key size, in bits, that ESAPI will support
129+
for <I>encryption</I>. (Note that any legitimate size is
130+
accepted for <I>decryption</I>.) So, for example, if you needed
131+
to be able to do encryption for 2-key Triple DES (aka, 2TDEA),
132+
then you would have to change this to '112'. Note that for a
133+
minimum key size of <U>larger</U> than 128-bits, you will need
134+
to have the JCE Unlimited Strength Jurisdiction Policy files
135+
installed on your runtime system.
136+
</FONT></P>
137+
</TD>
138+
</TR>
128139
<TR VALIGN=TOP>
129140
<TD WIDTH=249>
130141
<PRE><FONT COLOR="#ff0000"><FONT SIZE=2>Encryptor.ChooseIVMethod</FONT></FONT></PRE>
@@ -138,6 +149,8 @@ <H2>ESAPI.properties Properties Relevant to Symmetric Encryption</H2>
138149
compatibility with legacy or third party software. If set to
139150
“fixed”, then the property Encryptor.fixedIV must also be
140151
set to hex-encoded specific IV that you need to use.
152+
<B>NOTE:</B> "fixed" is deprecated and will be removed by
153+
release 2.3.
141154
</FONT></P><P><FONT SIZE=2>
142155
<B>CAUTION:</B> While it is not required that the IV be kept
143156
secret, encryption relying on fixed IVs can lead to a known
@@ -788,7 +801,7 @@ <H2>Acknowledgments</H2>
788801
KDF more in line with NIST's recommendations for KDFs as described in
789802
NIST Special Publication 800-108 (and specifically section 5.1). You can
790803
read about Jeff's review at
791-
<a href="http://owasp-esapi-java.googlecode.com/svn/trunk/documentation/Analysis-of-ESAPI-2.0-KDF.pdf">
804+
<a href="https://github.com/ESAPI/esapi-java-legacy/blob/master/documentation/Analysis-of-ESAPI-2.0-KDF.pdf">
792805
Analysis of ESAPI 2.0's Key Derivation Function
793806
</a>
794807
</p>

0 commit comments

Comments
 (0)