Cryptor plugin 1.0

Questions and answers on developing, deploying and using plugins and JavaBeans

Cryptor plugin 1.0

Postby IT2Be » Wed Mar 24, 2004 1:48 am

My third plugin for Servoy is packed with 12 functions all about encryption, encoding etc. It is named Cryptor.

You will find the following functions in here

Base64 encoding
1. Base64encode
Base64 encode a file, picture or any array of bytes into a string.

2. Base64decode
decode a string previously encoded into itM-^Rs original form.

Blowfish encryption
3. BLOWFISHencrypt
Blowfish encrypt a string with an optional user key.

4. BLOWFISHdecrypt
decrypt a string previously encrypted with the above function.

CRC32 checksum
5. CRC32
calculate checksum of a string, picture or whatever array of bytes

6. CRC32equals
compare a string, picture or whatever array of bytes agains an earlier calculated checksum

DES encryption
7. DESencrypt
java DES encrypt a string with an optional user key.

8. DESdecrypt
decrypt a string previously encrypted with the above function.

MD5 128 bits hash algorythm
9. MD5
calculate MD5 hash algorythm of a string, picture or whatever array of bytes

10. MD5equals
compare a string, picture or whatever array of bytes agains an earlier produced MD5 hash algorythm

SHA-1 160 bits hash algorythm
11. SHA
calculate SHA-1 hash algorythm of a string, picture or whatever array of bytes

12. SHAequals
compare a string, picture or whatever array of bytes agains an earlier produced SHA-1 hash algorythm


The result is attached. Just drop it in your plugins folder and restart Servoy.

REMARK: Be careful using it and test it first please since I lacked the time doing so. If you find any errors please report them te me.

Feel free to use it and distribute it but give me credit for it.
The plugin is free, provided M-^Qas isM-^R and I can not take any responsibility for the way it behaves or works.

Please give me feedback on what you think of it...

Cheers
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Re: Cryptor plugin 1.0

Postby bcusick » Wed Mar 24, 2004 3:35 am

IT2BE wrote:My third plugin for Servoy is packed with 12 functions all about encryption, encoding etc. It is named Cryptor.


Marcel,

You're the plug-in MAN! AWESOME JOB!

Cheers,

Bob Cusick
bcusick
 
Posts: 1255
Joined: Wed Apr 23, 2003 11:27 pm
Location: Thousand Oaks, CA USA

Re: Cryptor plugin 1.0

Postby Riccardino » Wed Mar 24, 2004 5:45 pm

IT2BE wrote:
Please give me feedback on what you think of it...


First of all: THANKS :D
Really a great job...
Base64 encoding
1. Base64encode
Base64 encode a file, picture or any array of bytes into a string.


I tried to use base64 encription, but it doesn't work (under OSX). I receive the first error because (I think) I used the sample, which uses a different syntax (plugins.it2be_cryptor.Base64encrypt instead of plugins.it2be_cryptor.Base64encode). But even using plugins.it2be_cryptor.Base64encode, I get an error.
I switched to Blowfish and everything seem to work fine.

Tested on OSX.3.3, Servoy 2RC9
User avatar
Riccardino
 
Posts: 911
Joined: Thu Apr 24, 2003 11:42 am
Location: Ferrara, Italy

Postby IT2Be » Wed Mar 24, 2004 5:53 pm

Hai Riccardino, I have tested it yesterday without errors but there could be something wrong nevertheless. And yes, the samples need some extra work but I prefer the functions first.

Base64 encoding takes (an array of) bytes and gives you a string. The other way round for decoding... Does that help? What dit you throw in?
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby Riccardino » Wed Mar 24, 2004 6:10 pm

IT2BE wrote:Hai Riccardino, I have tested it yesterday without errors but there could be something wrong nevertheless. And yes, the samples need some extra work but I prefer the functions first.

Base64 encoding takes (an array of) bytes and gives you a string. The other way round for decoding... Does that help? What dit you throw in?


I wrote this method (I first tried with base64, but it didn't work, so I changed to blowfish):
Code: Select all
var criptodesc = plugins.it2be_cryptor.BLOWFISHencrypt(anagrafica_to_patdent.descrizione)
anagrafica_to_patdent.descrizione = criptodesc
var criptofarma = plugins.it2be_cryptor.BLOWFISHencrypt(anagrafica_to_patdent.farmaco)
anagrafica_to_patdent.farmaco = criptofarma
var criptonote = plugins.it2be_cryptor.BLOWFISHencrypt(anagrafica_to_patdent.note)
anagrafica_to_patdent.note = criptonote
User avatar
Riccardino
 
Posts: 911
Joined: Thu Apr 24, 2003 11:42 am
Location: Ferrara, Italy

Postby IT2Be » Wed Mar 24, 2004 6:34 pm

OK but what are the field types of:

anagrafica_to_patdent.descrizione
anagrafica_to_patdent.farmaco
anagrafica_to_patdent.note

if this is text it won't work, you will have to convert it to an a byte value first in that case.

BTW encoding is something else than encrypting. What is it you want to archieve... If it is encryption then you should use either DES or Blowfish
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby Riccardino » Wed Mar 24, 2004 11:56 pm

IT2BE wrote:OK but what are the field types of:

anagrafica_to_patdent.descrizione
anagrafica_to_patdent.farmaco
anagrafica_to_patdent.note

if this is text it won't work, you will have to convert it to an a byte value first in that case.

BTW encoding is something else than encrypting. What is it you want to archieve... If it is encryption then you should use either DES or Blowfish


:oops: Right: I didn't pay attention to this detail... :lol:
Thanks
User avatar
Riccardino
 
Posts: 911
Joined: Thu Apr 24, 2003 11:42 am
Location: Ferrara, Italy

Re: Cryptor plugin 1.0

Postby Riccardino » Thu Mar 25, 2004 3:15 pm

IT2BE wrote:My third plugin for Servoy is packed with 12 functions all about encryption, encoding etc. It is named Cryptor.

You will find the following functions in here


Is there a way to check if Cryptor Plugin is installed?

Thanks
User avatar
Riccardino
 
Posts: 911
Joined: Thu Apr 24, 2003 11:42 am
Location: Ferrara, Italy

Postby IT2Be » Thu Mar 25, 2004 3:29 pm

Good idea, never thought of doing so but you can do it this way:

Code: Select all
if (!plugins.it2be_cryptor)
   application.output("no");
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany


Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 16 guests