JavaScript files by Henk-Reints.nl   Page last updated:

Please see the disclaimer below. This page will always be under construction. I continuously write all kinds of JavaScript and when I decide to publish it I'll put it here. The source files contain quite a large amount of comment, so on this page I'll be very brief about the scripts.

This page itself is quick and dirty, all files are given as normal HTML links. WARNING: left-clicking a link may cause it to run directly on your computer. To download a file you'll have to rightclick on a link and then choose "Save Target As..." You can save the files in any folder you like, although most sample scripts provided assume that the "*.js" files reside in a directory named "../js" relative to their own location. So best practice is to create a folder with subfolders "js" and "run". Then save the "*.js" files in the "js" subfolder and the others in the "run" subfolder.

About platforms: I test my scripts on Microsoft platforms only, using Windows Script Host 5.6 and MSIE 6. For any other platform or browser: Good luck! Please see the disclaimer below.

Security
Are my scripts safe to run? Yes they are. My scripts don't destroy data on your computer, they do not send any confident or private information to my (or any other) website, they are just nice tools and samples you can use on your own website or for performing tasks on your own computer.
But why should you trust me saying that? If you think a script is not safe then you should definitely not run it. Please see the disclaimer below. But all code is well documented JavaScript in plain text, so you can always try to find somebody who understands JavaScript and then have him/her check my code for insecure irregularities.

Why do I like the JavaScript language?
Despite the fact that JavaScript is not a very fast executing tool because it is an interpreted language, I like it because it IS a very powerful and flexible language. Together with the Windows Script Host it can perform almost any task on your PC. What I like most is that it's so easily accessibly: You only need a plain text editor (for example EditPad), the Windows Script Host, and Internet Explorer or a compatible browser. Then you simply edit your script, save it, and run it.

"We don't need a GUI that requires 3D processing just to look pretty, we need a system that works."


  • systemrestore.zip      
    A GUI interface and some scripts to list or create System Restore Points, as well as Restore the System to a given Restore Point. It does exactly the same as the standard System Restore User Interface provided by Microsoft, but I think mine is MUCH more User Friendly. Especially the CreateRestorePoint.wsf script can be used for unattended creation of Restore Points at moments YOU like them to be made. There is a readme file explaining the usage.

  • hrc4.zip    (init2 + new2 methods, bugfix in toDec; previous update: load method and hrc4string.js package)
    [view hrc4.js as plain text]   [view hrc4string.js as plain text]   [view hrc4.wsf as plain text]
    The HRC4 package now also includes a PHP version!
    This is my latest version of a script for binary string operations and data encryption. It is intended to replace the hr$crypto.js and hr$binstring.js files below. The .js file defines the HRC4 Object, the .wsf file is a simple implementation thereof. The latter can be used to encrypt/decrypt files on your hard disk or compute hash values of a file (although not very fast, after all it is and remains JavaScript). Read the files as plain text to find out more about their usage. The .wsf script and the .js file should be stored together in the same folder (e.g. C:\Tools or so). The .wsf script should be run in a Command Prompt window via Cscript.
    I have plans to create an HTML Application to embed it in a GUI. It will become available on this page when ready.

  • hr$stega.zip    (i.e. updated hrc4.js)
    [view hr$stega.wsf as plain text]   [view hr$bmpio.js as plain text]
    This is an example of performing steganography in JavaScript. Steganography is the art of hiding information within other data. This script can hide the content of any file within an image file, which must be a true color (24 bit) bitmap file (with ".bmp" extension). It can also reveal such information. Download the zip file, choose a folder where you would like to store the tool (for example C:\Tools) and unzip all files into that folder. Then open a Command Prompt Window and type: "cscript C:\Tools\hr$stega.wsf /?" for usage information. Please keep in mind that it is JavaScript, so it is not suitable for hiding large messages in large images! It uses hrc4.js to encypher the data to be hidden, and using the HRC4 pseudo random number generator it determines the pseudorandom locations in the image where successive bits of the hidden data are stored. This PRNG is initialised with the same key as is used for encyphering the message.
    Here is a demonstration page with an image (290 KB) containing a hidden file.

  • hr$cookie.zip   
    [view hr$cookie.js as plain text]
    This is a tool to read cookie information and display it as plain text in a Command Prompt window. It does NOT cleanup your cookies, but it shows you quite some detaisl about all cookies on your computer. I have plans to create an HTML Application to embed it in a GUI. It will become available on this page when ready.

  • hr$dirtool.zip      [view core script as plain text]
    is a JavaScript package for scanning directories in a Command Prompt Window or in batch files. It contains powerful switches to filter on file names, folder names, file dates, size, and attributes. Output can be sorted in many ways. Download the zip file, choose a folder where you would like to store the tool (for example C:\Tools) and unzip all files into that folder. Then open a Command Prompt Window and type: "cscript C:\Tools\ddir.wsf /?" for usage information. Note: this package includes one .exe file, which is Robin Keir's MD5File.exe.
    I have plans to create an HTML Application to embed it in a GUI. It will become available on this page when ready.

  • hr$des.js   [view as plain text]
    This is an implementation of the DES (Data Encryption Standard) algorithm, which is an older but still often used encryption method for electronic data. I do not yet have a demo page. It can be used together with hr$binstring.js (see below) or hrc4.js.

  • hr$randomtext.js   [view as plain text]
    This script contains an object to produce random text, which should be reasonably pronounceable according to Dutch pronunciation rules. Here's a demonstration page (with explanation in Dutch).

  • hr$entropystate.js   [view as plain text]
    This is (an attempt to make) a random number generator that produces unpredictable and irreproducible sequences of random numbers. It defines a Constructor for an Object Type name EntropyState, which can be updated by DHTML event handlers, so that it monitors user activity, which is fundamentally unpredictable by software or outsiders, and in itself not exactly reproducible. It also uses the system time as well as the built-in Math.random pseudorandom number generator to scramble the event details into an Array of 32-bit integers, from which random numbers can be obtained to produce sequences that should be quite secure for cryptographic purposes. Here's a demonstration page.

  • hr$mersennetwister2.js   [view as plain text]
    This is an Object Oriented JavaScript implementation of the Mersenne Twister, a very good pseudorandom number generator. Here are some scripts and output files for testing it:
  • See an example of the miserable performance of the JavaScript Array Object when it grows large.
    And in spite of that bad behaviour, I do like JavaScript as a language!

  • Sorting of Arrays
  • hr$crypto.js   [view as plain text]
    A small new library for arcfour encryption/decryption with decryption checking using SHA1. Here's a demonstration page. (see also hr$binstring.js).
    This packages is now obsolete, please use hrc4.js for new developments.

  • hr$binstring.js   [view as plain text]
    This script adds a number of properties and methods to the String Object to perform binary operations, for example data read from a file into one or more Strings. It enables manipulating binary files, although in sequential i/o only. It also contains functions for Hex encoding/decoding, Quoted Printable encoding/decoding, Base64 encoding/decoding, MD5, SHA, & HMAC computation, ARCFOUR encryption/decryption. Here's an ARCFOUR encryption/decryption demonstration page.
    This packages is now obsolete, please use hrc4.js for new developments.


DISCLAIMER:
HENK REINTS HAS WRITTEN THIS SOFWARE FOR HIS OWN USE, AS A HOBBY, WITHOUT ANY COMMERCIAL INTENTIONS. IT IS PROVIDED AS IS, WITHOUT ANY GUARANTEE FOR CORRECTNESS OR USABILITY. USAGE IS AT YOUR OWN RISK. IN NO WAY SHALL HENK REINTS BE LIABLE FOR ANY NEGATIVE CONSEQUENCES OF USING THIS SOFTWARE.
Copyright © 2004-2006 Henk Reints, http://Henk-Reints.nl
This copyright applies to all javascripts I have personally written and published on my web site, unless specified otherwise inside the script files themselves. When a script is a translation of someone else's product, then this copyright applies only to the translation, not to the underlying algorithms of the translated software. The software published on this page is free to be used or distributed, as long as it is left unmodified and includes this copyright and the URL: http://www.Henk-Reints.nl.

Get EditPad Pro or Lite
(my favorite text editor)