| Author |
Esapi Test Page
|
Michele Smith
Ranch Hand
Joined: Oct 27, 2010
Posts: 298
|
|
I am having trouble with the items which call the Esapi encryption, however, I am able to verify page level encryption. I highlighted in bold what I am having trouble with, it doesn't return a value at all. Thanks,
Michele
P.S. If you have any ideas at all about this, please let me know. Thanks,
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@page import="org.owasp.esapi.*"%>
<%@page import="org.owasp.esapi.crypto.CipherText"%>
<%@page import="org.owasp.esapi.crypto.PlainText"%>
<%@page import="org.owasp.esapi.errors.EncryptionException"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>ESAPI Test Page</title>
</head>
<body>
<%
String queryString = request.getQueryString();
String encryptedQueryString = ESAPI.httpUtilities()
.encryptQueryString(queryString);
//Map decryptedQueryString = (Map) ESAPI.httpUtilities().decryptQueryString( encryptedQueryString );
%>
<%
// parentId => encrypted query string
String parentId = ESAPI.httpUtilities().encryptQueryString(
request.getQueryString() );
%>
<p>
The encrypted querystring for the parameters (parentId) is:
<%=parentId%></p>
<p>
The encrypted querystring for the parameters (parentId) is:
<%="ESAPI:httpUtilities.encryptQueryString(parentId)"%> </p>
<% // userId => encrypted query string
String userId = ESAPI.httpUtilities().encryptQueryString(
request.getQueryString() );
%>
<p>
The encrypted querystring for the parameters (userId) is:
<%=userId%></p>
<p>
The encrypted querystring for the parameters (userId) is:
<%="ESAPI:httpUtilities.encryptQueryString(userId)"%> </p>
<% // homeid => encrypted query string
String homeid = ESAPI.httpUtilities().encryptQueryString(
request.getQueryString() );
%>
<p>
The encrypted querystring for the parameters (homeid) is:
<%=homeid%></p>
<p>
The encrypted querystring for the parameters (homeid) is:
<%="ESAPI:httpUtilities.encryptQueryString(homeId)"%> </p>
<% // mode => encrypted query string
String mode = ESAPI.httpUtilities().encryptQueryString(
request.getQueryString() );
%>
<p>
The encrypted querystring for the parameters (mode) is:
<%=mode%></p>
<p>
The encrypted querystring for the parameters (mode) is:
<%="ESAPI:httpUtilities.encryptQueryString(mode)"%> </p>
<%
// if ( decryptedQueryString.equals( queryString ) ) {
%>
</body>
</html>
|
 |
 |
|
|
subject: Esapi Test Page
|
|
|