473,385 Members | 1,622 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,385 software developers and data experts.

Question about Rabbit's AES encryption Article

7
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
Jul 17 '15 #1
9 1203
Rabbit
12,516 Expert Mod 8TB
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.
Jul 17 '15 #2
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.
Jul 18 '15 #3
lostme
7
Thanks Rabbit :) I'm going to test it out to see if it'll encrypt strings and files.
Jul 18 '15 #4
lostme
7
Thanks very much, NeoPa.
Jul 18 '15 #5
lostme
7
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.
Jul 19 '15 #6
lostme
7
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.
Jul 19 '15 #7
lostme
7
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.
Jul 19 '15 #8
Rabbit
12,516 Expert Mod 8TB
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.
Jul 20 '15 #9
lostme
7
Hi Rabbit,

Thanks very much for the reply, sorry I've been super busy and I'm just now writing back.
Jul 24 '15 #10

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

Similar topics

14
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...
5
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...
2
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...
7
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...
1
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...
3
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...
1
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...
1
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? ...
19
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...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.