By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,011 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

ASP No Cache

P: n/a
I was hoping someone can help me out.

I've searched the pages here and on numerous sites and cannot find an
answer that works. I'm trying this code RC4 Encryption/Decryption
http://www.planet-source-code.com/vb...=6646&lngWId=4

But there is no way (I can find) to clear the script afterwards. I'm
trying to make it secure and when I try Back buttons I can still see
the original code. I've tried all I could find for no-cache scripts
but none seem to work.

I'm a novice at ASP and so it's been a very frustrating journey. If
anyone can help out thhat'd be great

Thanks

Nov 17 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Try this code:

Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"C Elson" <ce****@aol-nospam.com> wrote in message
news:mi********************************@4ax.com...
I was hoping someone can help me out.

I've searched the pages here and on numerous sites and cannot find an
answer that works. I'm trying this code RC4 Encryption/Decryption
http://www.planet-source-code.com/vb...=6646&lngWId=4
But there is no way (I can find) to clear the script afterwards. I'm
trying to make it secure and when I try Back buttons I can still see
the original code. I've tried all I could find for no-cache scripts
but none seem to work.

I'm a novice at ASP and so it's been a very frustrating journey. If
anyone can help out thhat'd be great

Thanks

Nov 17 '05 #2

P: n/a
I tried adding that but now the page didn't even open it. I added it
here:
---------------------------------
<HEAD>
<TITLE>RC4 Encryption</TITLE>
</HEAD>
<BODY>
<%
Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")
%>
<H1>RC4 Encryption</H1>
<P>
This script encrypts and decrypts messages
with the RC4
algorithm. Enter the key (password) and a
message to
encrypt or decrypt in the fields below.
</P>

------------------------------
Any ideas?

Thanks
On Sat, 1 Nov 2003 16:42:33 -0800, "Steve C. Orr [MVP, MCSD]"
<St***@Orr.net> wrote:
Try this code:

Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")


Nov 17 '05 #3

P: n/a
I'd suggest you put those lines in your Page_Load event.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"C Elson" <ce****@aol-nospam.com> wrote in message
news:vf********************************@4ax.com...
I tried adding that but now the page didn't even open it. I added it
here:
---------------------------------
<HEAD>
<TITLE>RC4 Encryption</TITLE>
</HEAD>
<BODY>
<%
Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")
%>
<H1>RC4 Encryption</H1>
<P>
This script encrypts and decrypts messages
with the RC4
algorithm. Enter the key (password) and a
message to
encrypt or decrypt in the fields below.
</P>

------------------------------
Any ideas?

Thanks
On Sat, 1 Nov 2003 16:42:33 -0800, "Steve C. Orr [MVP, MCSD]"
<St***@Orr.net> wrote:
Try this code:

Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")

Nov 17 '05 #4

P: n/a
I'm sorry but I'm such a newbie at ASP that I have no clue how to do
that.
On Sun, 2 Nov 2003 20:36:24 -0800, "Steve C. Orr [MVP, MCSD]"
<St***@Orr.net> wrote:
I'd suggest you put those lines in your Page_Load event.


Nov 17 '05 #5

P: n/a
search for your Page_Load function, and put the code in there. If you are
doing inline you would have to create the function with the correct
signature inside script tags

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"C Elson" <ce****@aol-nospam.com> wrote in message
news:5c********************************@4ax.com...
I'm sorry but I'm such a newbie at ASP that I have no clue how to do
that.
On Sun, 2 Nov 2003 20:36:24 -0800, "Steve C. Orr [MVP, MCSD]"
<St***@Orr.net> wrote:
I'd suggest you put those lines in your Page_Load event.

Nov 17 '05 #6

P: n/a
On Mon, 3 Nov 2003 13:36:57 -0600, in
microsoft.public.dotnet.framework.aspnet you wrote:
search for your Page_Load function, and put the code in there. If you are
doing inline you would have to create the function with the correct
signature inside script tags

There, to my knowledge isn't a Page_Load function. Here's the entire
code which calls forth another page that nowhere could I find a
Page_Load command:

<%@ Language=VBScript %>
<%Option Explicit%>
<!--#INCLUDE FILE="RC4.asp"-->
<%
Dim lStrKey
Dim lStrMessage
Dim lStrResult
If Request.QueryString("Action") = "Decrypt" Then
lStrKey = Request.Form("Key")
%>
Encrypted:<BR>
<%=Request.Form("Encrypt")%><BR>
Decrypted:<BR>
<TEXTAREA name="Decrypt" rows="3" cols="50"
DISABLED><%=Decrypt(Request.Form("Encrypt"),lStrKe y)%></TEXTAREA>
<BR>
<%Else
If Not Request.Form = "" Then
lStrKey = Request.Form("Key")
lStrMessage = Request.Form("Message")
lStrResult = RC4(lStrMessage, lStrKey)
End If
%>
<HTML>
<HEAD>
<TITLE>RC4 Encryption</TITLE>
</HEAD>
<BODY>
<%
Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")
%>
<H1>RC4 Encryption</H1>
<P>
This script encrypts and decrypts messages
with the RC4
algorithm. Enter the key (password) and a
message to
encrypt or decrypt in the fields below.
</P>
<FORM method="Post">
Key: <INPUT name="Key"
value="<%=Server.HTMLEncode(lStrKey)%>"><BR>
<BR>
Message:<BR>
<TEXTAREA name="Message" rows="3"
cols="50"><%=Server.HTMLEncode(lStrResult)%></TEXTAREA>
<BR>

<INPUT type="Submit" value="Apply RC4"
id=Submit1 name=Submit1>
<BR>Now the above is all very well, but what
if you want to submit it to a SQL DB or something? Tada: Use the
Encrypt/Decrypt Methods!
</FORM>
<p>

<Form Action="demo.asp?Action=Decrypt"
Method=Post id=form1 name=form1>
Key: <INPUT
value="<%=Server.HTMLEncode(lStrKey)%>" DISABLED><INPUT Type="hidden"
name="Key" value="<%=Server.HTMLEncode(lStrKey)%>"><BR>
Encrypted Data for Submission to SQL:<BR>
<INPUT name="Encrypt"
value="<%=Encrypt(lStrMessage,lStrKey)%>" Type=Hidden>
<TEXTAREA rows="3" cols="50"
DISABLED><%=Encrypt(lStrMessage,lStrKey)%></TEXTAREA>
<Input type="Submit" Value="Decrypt"></Form>

<P>
Created by <A
href="http://www.lewismoten.com">Lewis Moten</A>. Modified by <A
href="mailto:sh*****@hotpop.com">Shmarya</A> for use in SQL Queries.
If you have questions about RCA and the
algorithms
that were released to the public domain, you
can read the
<A
href="http://www.rsasecurity.com/solutions/developers/total-solution/faq.html">FAQ</A>.
</P>
</BODY>
</HTML>
<%End If%>

Nov 17 '05 #7

P: n/a
Modify your code to do this
<%
Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")
%>
change to

<%
private void Page_Load(object sender, System.EventArgs e)

{
Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")
}
%>
--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"C Elson" <ce****@aol-nospam.com> wrote in message
news:od********************************@4ax.com...
On Mon, 3 Nov 2003 13:36:57 -0600, in
microsoft.public.dotnet.framework.aspnet you wrote:
search for your Page_Load function, and put the code in there. If you are
doing inline you would have to create the function with the correct
signature inside script tags

There, to my knowledge isn't a Page_Load function. Here's the entire
code which calls forth another page that nowhere could I find a
Page_Load command:

<%@ Language=VBScript %>
<%Option Explicit%>
<!--#INCLUDE FILE="RC4.asp"-->
<%
Dim lStrKey
Dim lStrMessage
Dim lStrResult
If Request.QueryString("Action") = "Decrypt" Then
lStrKey = Request.Form("Key")
%>
Encrypted:<BR>
<%=Request.Form("Encrypt")%><BR>
Decrypted:<BR>
<TEXTAREA name="Decrypt" rows="3" cols="50"
DISABLED><%=Decrypt(Request.Form("Encrypt"),lStrKe y)%></TEXTAREA>
<BR>
<%Else
If Not Request.Form = "" Then
lStrKey = Request.Form("Key")
lStrMessage = Request.Form("Message")
lStrResult = RC4(lStrMessage, lStrKey)
End If
%>
<HTML>
<HEAD>
<TITLE>RC4 Encryption</TITLE>
</HEAD>
<BODY>
<%
Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")
%>
<H1>RC4 Encryption</H1>
<P>
This script encrypts and decrypts messages
with the RC4
algorithm. Enter the key (password) and a
message to
encrypt or decrypt in the fields below.
</P>
<FORM method="Post">
Key: <INPUT name="Key"
value="<%=Server.HTMLEncode(lStrKey)%>"><BR>
<BR>
Message:<BR>
<TEXTAREA name="Message" rows="3"
cols="50"><%=Server.HTMLEncode(lStrResult)%></TEXTAREA>
<BR>

<INPUT type="Submit" value="Apply RC4"
id=Submit1 name=Submit1>
<BR>Now the above is all very well, but what
if you want to submit it to a SQL DB or something? Tada: Use the
Encrypt/Decrypt Methods!
</FORM>
<p>

<Form Action="demo.asp?Action=Decrypt"
Method=Post id=form1 name=form1>
Key: <INPUT
value="<%=Server.HTMLEncode(lStrKey)%>" DISABLED><INPUT Type="hidden"
name="Key" value="<%=Server.HTMLEncode(lStrKey)%>"><BR>
Encrypted Data for Submission to SQL:<BR>
<INPUT name="Encrypt"
value="<%=Encrypt(lStrMessage,lStrKey)%>" Type=Hidden>
<TEXTAREA rows="3" cols="50"
DISABLED><%=Encrypt(lStrMessage,lStrKey)%></TEXTAREA>
<Input type="Submit" Value="Decrypt"></Form>

<P>
Created by <A
href="http://www.lewismoten.com">Lewis Moten</A>. Modified by <A
href="mailto:sh*****@hotpop.com">Shmarya</A> for use in SQL Queries.
If you have questions about RCA and the
algorithms
that were released to the public domain, you
can read the
<A

href="http://www.rsasecurity.com/solutions/developers/total-solution/faq.htm
l">FAQ</A>. </P>
</BODY>
</HTML>
<%End If%>

Nov 17 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.