473,325 Members | 2,870 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,325 software developers and data experts.

Reading encrypted files in Java Script.

13
Hi All,
I want to store data in a encypted form (in form of some file) and later on i want to read encrypted data in Java Script and want to pass that encrypted buffer to some Active X component.

My first question how should i read/load a file in java Script and read its contents.?
Also is it possible to parse data in javascript?

Regards
Wanni.
Jan 29 '09 #1
10 3149
Dormilich
8,658 Expert Mod 8TB
if the file is on the client's machine you're out of luck (Javascript isn't allowed file system access). to access a file on the server you can use AJAX. but if you do server side stuff, maybe you don't need Javascript at all for ActiveX (besides the fact that ActiveX only works in IE).

regards
Jan 29 '09 #2
wanni
13
Thanks for your response.
Yeah my encrypted file resides on server, that means i have to use AJAX for reading contents of that file.

Actually my purpose is to send encrypted Data to ActiceX functions. So other possibility i am thinking that i can access encrypted file contents directly in ActiveX. So in order to achieve this i have to get the Web Page URLin ActiceX and through that URL i can get the path where file is present and after that i can access the contents of that file directly in ActiveX.

Can this is possible in ActiveX?

Regards,
wanni.
Jan 30 '09 #3
Dormilich
8,658 Expert Mod 8TB
@wanni
unfortunately I can't tell you, because
  • I don't have IE
  • ActiveX is not supported by browsers other than IE (so you'd exclude quite a lot of people)
  • in my opinion, IE is the worst browser available
Jan 30 '09 #4
acoder
16,027 Expert Mod 8TB
What exactly are you trying to do here (by reading encrypted files with ActiveX)?

If it resides on the server, let the server-side code decrypt it and then allow a download which you can use in any program on the client.
Jan 30 '09 #5
wanni
13
Hi,
Yeah i know i can use server side scripting in order to push the content on client side, but i dont want to use any server scripting language on server side.

Is there are any API's/Functions in ActiveX which downloads the file residing on server by opening some http steams etc.

regards,
wanni
Jan 30 '09 #6
acoder
16,027 Expert Mod 8TB
It probably is possible, but you'll need to give permissions and it should be used sparingly and with caution. Check the documentation on the MSDN website.
Jan 30 '09 #7
wanni
13
Thanks for all your response.
i Have one more question regarding Ajax. I want to read binary file in JavaScript.

I have code the following lines.

Expand|Select|Wrap|Line Numbers
  1.     var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); 
  2.  
  3.     xmlHttp.onreadystatechange = function() { 
  4.         if (xmlHttp.readyState == 4) { 
  5.     result = xmlHttp.responseStream;
  6.     alert(result);
  7.         } 
  8.     }
But this is not working. Can u tell what is problem in above code.

Regards
wanni.
Jan 30 '09 #8
Dormilich
8,658 Expert Mod 8TB
the official docs (http://www.w3.org/TR/XMLHttpRequest/) do not mention this property (responseStream), so you can't expect it to be always working.

It seems to be part of "MSXML2.XMLHTTP.3.0" as source for the XMLHttpRequest.
Jan 30 '09 #9
wanni
13
Thanks for your response.
Can i believe there is no other way of reading binary files in JavaScript in IE.
Jan 30 '09 #10
acoder
16,027 Expert Mod 8TB
If it's just IE, you can use responseBody in place of responseStream.

Then, in ActiveX, you could use the FileSystemObject, and failing that, ADO.Stream.
Jan 31 '09 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Philipp Brune | last post by:
Hi all, the following problem occured to me and I hope somebody can help me : I need to implement an encrypted File download with a PHP script on the server side and a c# client application....
2
by: Giacomin Alan | last post by:
Hi everybody...I would like to know if it is possible and how to work with files in javascript. Thanks. **Alan**
6
by: Carolyn Vo | last post by:
Hi there! I have a string that was encrypted in Java using the classes DESKeySpec, SecretKeyFactory, SecretKey, and Cipher. It looks like using the SecretKeyFactory puts a transparent layer on...
8
by: robert | last post by:
Hello, I want to put (incrementally) changed/new files from a big file tree "directly,compressed and password-only-encrypted" to a remote backup server incrementally via FTP,SFTP or DAV.... At...
5
by: Michael Sperlle | last post by:
Is it possible? Bestcrypt can supposedly be set up on linux, but it seems to need changes to the kernel before it can be installed, and I have no intention of going through whatever hell that would...
5
blazedaces
by: blazedaces | last post by:
Ok, so you know my problem, java is running out of memory reading with SAX, the event-based xml parser intended more-so than DOM for extremely large files. I'll try to explain what I've been doing...
1
by: MimiMi | last post by:
I'm trying to decrypt a byte array in java that was encrypted in C#. I don't get any error messages, just a result that's completely not what I was hoping for. I think I am using the same type of...
2
by: MimiMi | last post by:
I'm trying to decrypt a byte array in java that was encrypted in C#. I don't get any error messages, just a result that's completely not what I was hoping for. I think I am using the same type of...
3
by: TheLostLeaf | last post by:
Hi, I wote some code that encrypts binary files, and decrypts them, works great. It uses the same file name, so if the file is called mountain.jpg, it encrypts it with the same name. I'm...
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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)...
1
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: 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.