473,320 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Encrypting a download on the fly

Hi, im wanting to outpout a binary file from ASP, but encrypt it on the fly
according to a given seed (retrieved according to the users login).
But ive fallen at the first hurdle, and cant even seem to get access to the
raw bytes of the file as I pass it through. The code I have written is thus:

----------------

objStream.LoadFromFile( "D:\\" + filename );

//Output the contents of the stream object
Response.ContentType = "application/none";
Response.AddHeader( "Content-disposition", "inline; filename="+filename );
Response.AddHeader( "Content-Length", objStream.Size );

// reset the stream back to 0
var index;
objStream.Position = 0;

while (objStream.Position < objStream.Size)
{
var testbyte;
var ibound;

testbytes = objStream.Read(1000);
ibound = 0;

Response.Write(testbyte);

while (ibound < ubound(testbyte))
{
Response.WriteBinary(testbyte(ibound));
ibound = ibound + 1;
}
}

----------------

This code isnt supposed to do anything other than pass the bytes back (in a
convulted way) which i will later turn into encryption. But I can access the
raw bytes using testbyte(ibound) it seems. Will someone please enlighten me,
Ive spent all night fighting HTTP 500 errors :(

Thanks

Paul
Jul 19 '05 #1
2 1775
Your first line may be causing you some grief...

objStream.LoadFromFile( "D:\\" + filename );

I guessing it should be:

objStream.LoadFromFile( "D:\" + filename );

Not sure if that helps?!?!
Jul 19 '05 #2
No, the double backslash is correct for JScript.
"Scott" <sc***************@hotmail.com> wrote in message
news:2f**************************@posting.google.c om...
Your first line may be causing you some grief...

objStream.LoadFromFile( "D:\\" + filename );

I guessing it should be:

objStream.LoadFromFile( "D:\" + filename );

Not sure if that helps?!?!

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ed J | last post by:
I need some sort of file encryption that I can invoke from my PHP web pages, to protect sensitive files uploaded/downloaded by clients. I use https (SSL) for the upload/download, but once the...
7
by: steve | last post by:
Hi, I know there are a few free and paid php source code encryption scripts around. Has anyone used one, and any feedback? I am interested in encrypting source that is placed on a remote host....
14
by: David Williams | last post by:
Hello all. Anyone know of a free program I can use to encrypt my php code? I would like it to be secure as possible. i.e. not viewable from the web. Also, is there an html encryptor or will...
12
by: kimi | last post by:
Hello, I am running Microsoft SQL Server 2000 on a Windows 2000 Sever. I have been working with SQL Server, Building ASp WebSites for many years now. I am by no means an expert - nor have I had...
3
by: Piotr | last post by:
MS has published on its sites javascript encoder, which enables "encrypting" javascript code. It allows hiding js code from being seen as a text file. There is a decoder for it, available in the...
6
by: Dayne | last post by:
Guys, I am writing a database application(vb.net , sql server) and is presently storing the connection settings in a xml file...not very secure though. What is a safer method in a dynamic...
7
by: Richard L Rosenheim | last post by:
Anyone care to express their two cents over pros and cons of encrypting the data being transmitted (within the SOAP package) versus just utilizing a HTTPS connection? Richard Rosenheim
4
by: JJ | last post by:
I need to encrypt credit card # and store that in a database (and be able to decrypt it). Any codes that use strong encyption algorithm like AES 256 on the web that I can copy and paste? Thanks
2
by: Amar | last post by:
Hi All, I want to insert my password into the mysql database by encrypting it so that I can also retrieve the password. Before I was using sha1() for encrypting password,but it is an one way...
2
by: SeeSharp Bint | last post by:
Visual Studio 2005, dotnet, c#. Microsoft SQL Server. Windows XP forms application. Temporarily, for my database application, I have been storing the various elements of database connection...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.