Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 8:40 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Encryt problems
PostPosted: August 29th, 2007, 11:32 pm 
Offline

Joined: March 8th, 2005, 9:40 pm
Posts: 63
Hi,

I am writing variables to a file with the following code:
Code:
var textObj = OpenFile(SYSTEM_PUBLICATION_DIR+"\\"+IDinput+".txt")
textObj.WriteLine(Nameinput,false,true,"abc")
textObj.WriteLine(Passinput,false,true,"abc")
textObj.Close()


When I try to read it back on another page with this code:
Code:
var textObj = OpenFile(SYSTEM_PUBLICATION_DIR+"\\"+IDinput+".txt")
Username = textObj.ReadLine(true,"abc")
Userpass = textObj.ReadLine(true,"abc")


I get the encrypted code.
What have I done wrong? :oops:

Regards

Neil

_________________
Opus Pro V6
Dell Inspiron 9400
Intel Centrino Duo 2GHz
2 Gig Ram
XP SP2


For this message Nitro has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: August 30th, 2007, 1:03 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Nitro,

You need to add a false for the quotes on the ReadLine:

var textObj = OpenFile(SYSTEM_PUBLICATION_DIR+"\\"+IDinput+".txt")
Username = textObj.ReadLine(false, true,"abc")
Userpass = textObj.ReadLine(false, true,"abc")

This one made me think :-) but then it is 1 in the morning, guess it's time for bed.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Thanks Again
PostPosted: August 30th, 2007, 11:31 pm 
Offline

Joined: March 8th, 2005, 9:40 pm
Posts: 63
Hi Mack,

Once again your help has proved invaluable. :D

I have attached my Login.imp file. I know that it is not a good example of scripting :oops: , but it works in my app.

I needed an alternative to the solution given in the Opus Login sample, as I have to track all my learners by a unique ID code. A name was not good enough as there maybe two Joe Smith's. I also have to track learners from multiple sites/installations.

It also provides the learner with info, as to, where their login problem is and lets them correct it, without having to re-enter all their info again.

Any ideas to improve this would be appreciated. Not only by myself, but also for any other inexperienced (like myself) Opus users.

Thanks again for your help.

I also need to thank Graham Baglin, I got the original idea on how to start with this, from a posting of a script by his son Wade.

Regards

Neil


You do not have the required permissions to view the files attached to this post.

_________________
Opus Pro V6
Dell Inspiron 9400
Intel Centrino Duo 2GHz
2 Gig Ram
XP SP2


For this message Nitro has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: August 31st, 2007, 12:47 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Unconventional, but effective. Given the issue some people have with scripting for databases, this is a smart way to manage users.

My first ideas would be what I call the idiot test - which basically means I play completely dumb and see what problems I run into. I would suggest from this providing clearer instructions on screen for the user - down to actually pressing return once the data is enter.

I'm not sure what role this individual 'cards' play in the whole program, but if they are likely to contain additional information - then I would suggest treating them as INI files (I don't think you have to actually tag them .ini). You can still use the standard writeline commands, but by adding keys and the read section data you could instantly call specific values or sections.

If you've downloaded the IKIQ program I've posted under the SHOWCASE section, open the questions.ini file for an example of how I use this. The encryption is actually provided via a DLL (256bit) mainly because I can manage encrypted strings within the script rather than just writing to disk.

Me being a neatness freak you could store the files in their own subfolder (?) and if necessary link the 13 digit code to the site that you mention?

How will handle people with lost passwords or forgotton ids. Prehaps, some kind of master file that writes the new user name and id to end of the list EG:

name1
id1
name2
id2
name3
id3

Just had a thought about this one: Somebody recently has posted about trying to remove all tmp files from windows. If you maintain a list of ids, you would know all the file on the system can could manipulate this data in various ways, such as deletion, list production, etc.

Lastly, and I've had this conversation with several people - any form of data collection usually has to meet some kind of data protection standard. If these files are in the program directory, will people have access to them and other peoples personal data - inlcuding what's in your program as well as what you've stored in the file.

Overall, like the idea and the coding is fine :-)

Hope this helps,

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: August 31st, 2007, 10:45 pm 
Offline

Joined: March 8th, 2005, 9:40 pm
Posts: 63
Hi Mack,

Thanks for taking the time to look at this. :D I am on a huge learning curve, and sometimes feel that, with no previous programming experience, I have taken on a task far beyond my current competency. (I spent hours on Sunday trying to debug a script, only to eventually find, that the problems were caused by using => instead of >=, and that I had left out the + signs on both sides on one of the variables. The error was indicated on a completely different line, where the " }" character to end the "if" statement was.) :oops: I try to sort out problems on my own, before posting, as while this takes time, it is normally the best way to learn.

The imp is just an example for posting purposes, the actual application has detailed instructions and a help screen, as many of the users are not completely computer literate.

The programme will not be distributed to end users but will be registered to and reside on PC's in our branch offices, so my biggest concern is not with the files being tampered with or decrypted, but more that some ignoramus will delete them by accident. I intend to try to negate the effects of this by immediately emailing the key files and the results to a specific e-mail address.

I love the idea of using .ini files and writing/calling specific values or sections. I will definitely research this and try to implement this in the second version of the application. (I have a bit of pressure to get the first release out.)

A potential problem with this is that there is no defined order in which a student performs the test. Imagine a Cell Phone, where the student has to perform certain functions, but the order is irrelevant, provided the cell phone functions as required when all the tasks have been completed. I have managed to achieve this with a very basic method.


I will probably need to increase the security in future versions and will research on how to use DLL's to do the encryption for future versions and other applications on my to do list which will need 256bit encryption.

All user files are stored in their own subfolders.

In terms of lost passwords or forgotten ID's, after reading your reply, I realise that I had not given this sufficient consideration and will rectify it before publication.

In terms of deleting files, I have managed to do this by researching posts on this forum and with additional help from Duncan Lilly. The zip is posted at: viewtopic.php?t=2845&highlight=


I downloaded your IKIQ programme before your reply, but never had time to look at the questions.ini file at the time. I did the quiz, and did not do as well as I had expected to (5 wrong :oops: ; but I did not attempt the deciphering, - just used my general knowledge, which has limitations on South America and Eastern Europe).

When I looked at the ini file, I realised that I need to learn a lot more before even trying to tackle this.

Well done on the IKIQ programme, my only comment on this is that double clicking on the square "Return to front page" button does not work, I realise that this is probably because this is an Alpha release and there is no front page.

Regarding data protection, I will need to look at this. Is it possible to encrypt a file name and read back the encrypted file name in actions and/or script?

Lastly, is it possible to change the Opus logo in the All Programs menu? This is probably not properly explained, so I have added an attachment.

Thanks again for your help. If it were not for the ease of use of the Opus programme itself, and for the help provided by yourself and many others on this forum, I would never have been able to achieve nearly as much as I have so far in the writing of this application!

Regards

Neil

A feeble attempt at a Haiku:
"I try to programme
but it does not always do
what I want it to"


You do not have the required permissions to view the files attached to this post.

_________________
Opus Pro V6
Dell Inspiron 9400
Intel Centrino Duo 2GHz
2 Gig Ram
XP SP2


For this message Nitro has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: August 31st, 2007, 11:55 pm 
Offline

Joined: November 11th, 2004, 4:05 am
Posts: 636
Location: Christchurch, NZ
Nitro wrote:
I am on a huge learning curve, and sometimes feel that, with no previous programming experience, I have taken on a task far beyond my current competency."


Hi Nitro,
I think you are progressing well -- the file you posted is well implemented.
Spent hours debugging a script??
That has happened to all of us.
You explain your problems well and give good feedback to suggestions; I wish that everyone who requested help did the same thing.

You are doing fine.

Paul


For this message Paul has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: September 1st, 2007, 12:18 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
5 wrong, I know somebody that only got 5 right :-)

Yes, I don't see why not. As you can define the file name in the script, these could be encrypted before saving the file, then when the student enters their id (file name0, this could be encoded and the correct file found.

Quote:
Regarding data protection, I will need to look at this. Is it possible to encrypt a file name and read back the encrypted file name in actions and/or script?


The icon is specified by the installation software, and as I didn't provide one (being an alpha version) it will default to the exe. I'm sure the final release will have something more suitable :-)

Quote:
Lastly, is it possible to change the Opus logo in the All Programs menu? This is probably not properly explained, so I have added an attachment.


Mack,

p.s thanks for the info about the wildcard delete on the other post. I get som used to using script over actions that I forget actions can do somethings the scripts can't.

p.p.s as for debuging issues, I spent a day unpicking code because I'd caught my wrist on the laptops tracker pad shortly before closing down the night before and managed to insert a space into some obscure section of the code. Best advise, keep the coding sections short and check the error box constantly.

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Thanks for the encouragement
PostPosted: September 1st, 2007, 2:28 am 
Offline

Joined: March 8th, 2005, 9:40 pm
Posts: 63
Hi Mack & Paul,

I really appreciate your encouragement and help. As a novice, I try to avoid posing problems that are unclear, as I have learned in life, that these just normally result in more questions than answers.

When looking for a new staff member, I prefer to look for someone that has a logical ability as opposed to just subject matter expertise. Logic is inherent; subject matter expertise can be learnt.

I remember a line in the movie “An officer and a gentleman” – starring Richard Gere, that said something like – “It is easier to teach a fighter to become a gentleman, than to teach a gentleman to become a fighter…” (I was a Senior Marine NCO and then a Marine Officer, before I got into my current (non military related) profession, but the skills I learnt in the military, while not accredited, have proved invaluable to my personal development) I feel that it is easier to develop someone with a logical ability to programme, than to develop a trained programmer without logic. (Well, that’s my opinion, as a novice.)

Quote:
Mack you said:
“Yes, I don't see why not. As you can define the file name in the script, these could be encrypted before saving the file, then when the student enters their id (file name0, this could be encoded and the correct file found.”


Could you give me a clue as to how I should start with this, I know I am cheating and should (and normally would) spend hours working on this.
But my version 1.00 of the application is expected by Monday. So the pressure is huge and I am so close….

All I had left on my version 1.00 “todo list” was to automatically mark the app. A big enough challenge by itself, considering my current knowledge. (I have some ideas on how to do this, I just wish I had known more about ini files before I started on this.)

Unfortunately I now realise that this is no longer sufficient, so I have a lot to do, if I want to achieve this before Monday.

I am already in trouble as was my girlfriends birthday, and I am still working at 03:12 am….


Regards

Neil

_________________
Opus Pro V6
Dell Inspiron 9400
Intel Centrino Duo 2GHz
2 Gig Ram
XP SP2


For this message Nitro has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: September 1st, 2007, 11:55 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Morning Nitro,

Best not forget the b-day. GFs can be very unforgiving - especially where machines are concerned :-)

I use a DLL, found by Stephen, to manage encrypted strings within Opus - with the major added bonus that it's 256bit AES standard. It's called 1crypt:

http://www.atma-software.com/1crypt/

Basically, I create a a function that is passed two values - the string, and the process. In you case, the string would be the ID used to create the file name. The process is simply whether function encypts or decrypts. As the DLL is very reasonable and can be distrobuted with any copy of your software, it makes economic and time sense to use this. If you decide to go this way, let me know and I'll post the function.


Alternatively, a you could use the same principle but create your own substitution cipher. This is basically the same as the method I use in the IKIQ program to to convert strings to their ascii value or ROT13.

Mack,

P.S just had another thought about your login, if your users have to pick an id - is there a possibility that they are going to choose the same ones? I know you've got 13 digits, but I bet that a lot of people still have 1234 as their pin number (British Banking).

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: 1crypt
PostPosted: September 1st, 2007, 2:21 pm 
Offline

Joined: March 8th, 2005, 9:40 pm
Posts: 63
Hi Mack,

Thanks for the info, I will play with 1crypt and get back to you.

The ID that the application requests is our local equivalent of the US Social Security Number. So everyone has a unique 13 digit ID.

Regards

Neil

_________________
Opus Pro V6
Dell Inspiron 9400
Intel Centrino Duo 2GHz
2 Gig Ram
XP SP2


For this message Nitro has been thanked by : mackavi


Top
 Profile  
 
 Post subject: 1crypt
PostPosted: September 2nd, 2007, 8:15 pm 
Offline

Joined: March 8th, 2005, 9:40 pm
Posts: 63
Hi Mack,

I would appreciate it if you could post me the function or else you could e-mail it to me at neilshome@mweb.co.za

Regards

Neil

_________________
Opus Pro V6
Dell Inspiron 9400
Intel Centrino Duo 2GHz
2 Gig Ram
XP SP2


For this message Nitro has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: September 2nd, 2007, 8:36 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
function sent by email.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 33 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group