Wednesday, 11 March 2009

Javascript: A list of Javascript Framework

Thought I'll compile a list of common javascript framework/libraries that i've come across:
List will be built up gradually.

jQuery - http://jquery.com/
prototype - http://www.prototypejs.org/
mootools - http://mootools.net/
moofx - http://moofx.mad4milk.net/
ExtJS - http://extjs.com/
script.aculo.us - http://script.aculo.us/

Wednesday, 4 March 2009

Persits ASPEncrypt: Encrypt uploads and Decrypt downloads

Downloaded demo version of ASPEncrypt from persits website.
Needed to provide AES (Advanced Encryption Standard) level encryption based on Rijndael - developed by two Belgian crytographers named, Joan Daemen and Vincent Rijmen - name was a portmanteau of their names.

Anyway, couple of issues :

i look at the samples available from ASPEncrypt. These are installed under the Persits folder under program files.

The sample I worked of was located in the "upload_download" folder.

I changed the default CSP provider so I can use AES256. The docos provided regarding the naming of the CSP was a bit vague. All it said was to include the words prototype if you're on an XP machine. Tried to prefix to start with but didn't work, then end up looking in the registry for actual CSP name.

Check registry in the following locations to see list of CSP installed on server:

HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\Defaults\Providers

Code now changed to:


Set Upload = Server.CreateObject("Persits.Upload")
Set CM = Server.CreateObject("Persits.CryptoManager")
Set Context = CM.OpenContextEx("Microsoft Enhanced RSA and AES Cryptographic Provider (Prototype)", "mycontainer", True )
Set Key = Context.GenerateKeyFromPassword("password", , calgAES256) ' use defaults
'Key.EncryptText("Some text")
Upload.SaveEncrypted "c:\upload", Key, "xxx"

For Each File in Upload.Files
Response.Write "Name=" & File.Path & "; Size=" & File.Size & "
"
Next


This still threw an error for me :

Persits.CryptoManager.1 (0x800A0009)
Invalid algorithm specified.

Found out I needed the following metadata as well to allow the use of the following macros "calgAES256"


METADATA TYPE="TypeLib" UUID="{B72DF063-28A4-11D3-BF19-009027438003}"


Enclose them in a set of HTML comment tags.