I followed the encryption demo with no problems, but I just cannot seem to load the crypto javascript code into my existing project properly without getting a error when trying to encrypt a simple line of text.
Uncaught TypeError - Cannot read property 'length' of undefined. line 3 column 98
How do I ‘include’ that stanford crypto library so that it works?
I have a string - txtPassword with a defined alpha numeric password - no keywords are in it. I have a string in txtRegFullName - nothing weird in there. All strings are surrounded by double quotes. This is BASIC code.
Anyone else having problems? It works on the example app, but not on my project. I really don’t want to have to start over due to all the form design i’ve completed.
If you mean which controls, common, bootstrap 4 and jqwidgets.
However, I am doing this entirely in code right now.
It’s not working.
Here is the code (just the stuff I am trying to encrypt right now):
Function btnRegGo_onclick()
Dim txtRegFullName, txtRegAddress, txtRegPhone, txtRegEmail, txtRegUsername, txtRegPassword, txtPlain, txtPassword, webURL, newPublicKey, txtEncrypted
Rem Put dummy data to test saving and encryption
txtRegFullName = "Mike Felker"
txtPassword = "12ghYT43Bscx"
txtEncrypted = sjcl.encrypt(txtPassword.value, txtRegFullName.value)
NSB.MsgBox(txtEncrypted.value)
end function
I am getting errors and no message box. I have the library checked and I created a code file in project and copied and pasted the StanfordJavascriptCryptoLibrary in place - followed the directions of the blog post.
That’s not going to work, for reasons that have nothing to do with sjcl.
You’re being inconsistent with the use of .value. This works:
Dim txtRegFullName, txtRegAddress, txtRegPhone, txtRegEmail, txtRegUsername, txtRegPassword, txtPlain, txtPassword, webURL, newPublicKey, txtEncrypted
Rem Put dummy data to test saving and encryption
txtRegFullName = "Mike Felker"
txtPassword = "12ghYT43Bscx"
txtEncrypted = sjcl.encrypt(txtPassword, txtRegFullName)
NSB.MsgBox(txtEncrypted)