Hi Rabbit,
Can you explain the following line in the RunAES procedure (Cipher-block Chaining mode)?
For i = 0 To (Len(oPW.Value) - 1)
Specifically: What does oPW represent? I thought it was a string but then the 'o' made me think it was an object. I'm trying to understand the algorithm, so I'm stepping into it and having trouble resolving the opw.Value
Thanks very much in advance.
(z)Referring to AES Encryption Algorithm for VBA and VBScript 9 1204
The oPW is a textbox on a form that holds the password that will be used to encrypt the file. You can, if you wish, replace it with a string.
NeoPa 32,556
Expert Mod 16PB
Good work tidying this up Z :-)
Rabbit has it covered and we can monitor it to ensure the OP gets all they need.
Thanks Rabbit :) I'm going to test it out to see if it'll encrypt strings and files.
Hi Rabbit,
I've also had to adjust a few things, namely variable declarations (as you know, VBScript doesn't require the type when declaring a variable but I'm running the code as VBA), anyway, I first ran the code passing in a file as argument, the code executed without exceptions but I checked the processed file and the text inside was still plain text, not encrypted. I also ran the code supplying a string to see if it'd obfuscate the string but it didn't.
Do you have a sample file that you fed into the script? I'm curious as to your results after running the same code. Thanks very much in advance.
Sorry, I missed the .enc version of the file, the encrypted version came with a default file launch type, I picked Notepad to open it. My further questions are:
* How do I decrypt the same encrypted file?
* What if I want to encrypt a string using the script? How would I modify the code to target an input string instead of file to encrypt?
Thanks very much in advance.
Another side-effect of the script is that the original file remains, so I guess if I had to implement the script, I'd have to delete the original file, otherwise the encrypted version would be compromised by the fact that its plain text version would still be available in the same location.
Decrypting is done by passing the .enc file into the same function. It sets the mode based on the extension. You can set that differently if you wish. For example, by passing in an additional parameter to the function that sets the mode.
To encrypt a string, take out the references to files and change them to strings instead, change the sub to a function, and have the function return the string result instead.
To remove the unencrypted version of the file, add a line of code that deletes the original file.
Hi Rabbit,
Thanks very much for the reply, sorry I've been super busy and I'm just now writing back.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jeff |
last post by:
Ok. I am creating a table in an access DB based on a form submission. This
works fine. The problem I am having is, if there is a space in the
submission. For example.... someone submits "The...
|
by: Harman Sahni |
last post by:
We have a public and private key pair for Credit Card data encryption.
The database part is all done where we generated the key pair.
Public key resides in the database for encryption and we...
|
by: jagivens |
last post by:
Hi,
I have two identical programs that encrypt characters. One is written
in C++, and it works, but the other one is written in C, and it does
not work. I have copied the code below. There is...
|
by: B Maxey |
last post by:
I have been working with encryption. And it seems to me that the IV and Key
are the only things you need to decrypt my data.
I can obfuscate, but my program still needs to 'call' the framework...
|
by: Gary Bond |
last post by:
Hi,
Posted this in the .Net.Security forums but did not get any replies - anyone
here got any expreience of this,
Thanks,
Gary
------------copy--------------------
Hi All,
Just a quick...
|
by: Chuck P |
last post by:
I need to deploy and asp.net 2.0 application that has dpapi/machine
encrypted connection strings.
I tried using the VS Build Publish menu selection and then putting the
encryption in the...
|
by: Daniel Mark |
last post by:
Hello all:
I follow the following tutorial
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/108598
Description:
script for making executables with py2exe
##############
from...
|
by: =?Utf-8?B?bWljcm9ob2Y=?= |
last post by:
Short version:
Is there a way to configure (preferably programmatically) the max encryption
strength that will be used by the framework when connecting to a particular
SSL-protected web service?
...
|
by: klenwell |
last post by:
Another request for comments here.
I'd like to accomplish something like the scheme outlined at this page
here:
http://tinyurl.com/3dtcdr
In a nutshell, the form uses javascript to hash...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |