Error: Only up to 6 modules are supported in this layout. If you need more add your own layout.

A while back I posted a short video of the Booking Wizard I was working on for a client (follow the link for some of the original screenshots, twitter announcements, etc).

Finally there has been the time and the need to make this into a class. The code is up on GitHub and as soon as I post this article I have to start actually implementing the class into the real project so you probably wont see me for a few days 🙂

I would love to hear what you think and what you end up doing with the code. Feel free to fork the project and contribute back any changes you make too…

Design Time View Run time view!

Built in themesOther features

 

Go take a look at the ClarionMetroWizard GitHub Repo !

Oh, and for the impatient.. try the pre-compiled demo!

This post is a heads up to let you know that the syntax highlighting package for Clarion, SublimeClarion, is now available from Sublime Package Control!

If you have not done so already, first install Sublime Package Control as described here then install the SublimeClarion package via the command palette. .. couldn’t be easier! More details on command palette usage here.

 

image

-brahn

Recently I was working with JP to make some adjustments to the AccessoryMenu addin so he could have the Accessory sub menu at the top instead of the bottom of the help menu. While I was in there I decided to make a few more tweaks and add some support for translations.

I have uploaded the VS source code as well as the compiled binaries to Google Project Hosting in case anyone wants to play – https://code.google.com/p/clarion-accessory-addin/

Note: This has not been approved by the Clarion 3rd Party Association as an official update to the Clarion7 install standard so please use your common sense when considering this addin! I wanted to make the source available so that if there is interested perhaps others would like to contribute.

Other Note: I am also evaluating Google Project Hosting as a possible destination for the source of all the other addins. They are currently being hosted on http://www.assembla.com/ but the google option looks like it has pretty sweet support for open source projects which I think is what I want to do with the current addins. I would love to hear your thoughts, leave a comment or send me an email.

From http://www.strategyonline.co.za/accessories/jblowfish/

J-Blowfish is a Clarion wrapper (pure Clarion source, no black boxes) for the Blowfish  encryption algorithm. Most of this code was written by Andy Ireland  – we have added a helper class, examples, templates, etc.

I learnt a lot looking into this code a few years ago (wow, it was 2006 looking at my notes!). At the time we needed an implementation of the Blowfish Encryption Algorithm to share encrypted data between a Clarion and Java application. J-Blowfish seemed like a great fit but unfortunately we found that it was not producing standard encrypted data and was also unable to decrypt anything produced by another implementation.

The solution at the time was to use a C DLL instead. This worked fine but seemed a bit ugly, I would have much preferred a pure clarion solution. Also, the code in  jblowfish.clw intrigued me.

NOTE: This is just me poking around in things to learn something new. Don’t blame me if following anything in this blog sinks your submarine or whatever 🙂

Here is what I found…

(It is simpler to deal with hex output so that is the only section I have looked at but the results impact all encrypt/decrypt functions.)

1st, Implementation problem:

(In the “Main” procedure of BlowDemo.app)

In the demo supplied with J-Blowfish the local variable holding the key is not clipped. This means the actual key used for the Encryption is inclusive of the trailing spaces in the STRING.

Additionally, the blowfish encryption mode implemented in J-Blowfish (which I believe is ECB) requires your data to be a multiple of 8 bytes. The original implementation will pad an extra 8 bytes if the data is already a multiple of 8.

Original:

Suggested improvements:

2nd, Encryption problem (jblowfish.clw)

The “BlowFish._Encrypt” method seems to be the culprit in the encryption errors I experienced.

In my testing I was using this data:

key: “abc”

plain text: “abcdefgh”

encrypted result (other tools): “94c559d64e1251fb”

I discovered that if in the BlowDemo.exe I used this data, “dcbahgfe” I would get the correct result (almost… the result was also backwards “d659c594 fb51124e”)

So it came down to a problem with the way the data was being passed to the “self.BF_Encrypt(pWork, pWork2)” part of this method.

(note: the BF_Encrypt method is used successfully in the BlowFish.Initialise method, I checked the values being generated and they are all correct)

Basically I believe this is because the Endianness of clarion longs is different to whatever assumption is made in the algorithm J-.Blowfish is based upon.

This is what I came up with:

Other considerations:

  • This only takes care of the Encryption phase something similar will need to happen in the Decrypt method.
  • There may be better ways (band, bshift, bxor, whatever) to do this but it was late and this way is at least descriptive 😉
  • I passed a few of the standard test vectors through the changed version and it seems to work correctly now. Most implementations have in them somewhere a self test method that uses these test vectors to prove they are running correctly:

    http://www.schneier.com/blowfish.html

    http://www.schneier.com/code/vectors.txt

  • One thing I learned (amongst many!) whilst doing all this. It seems you can safely do a search replace in jpwbfish.inc and jpwbfish.clw to replace all ULONG’s with LONG’s. This may even result in some speed improvements as supposedly longs are faster then ulongs. Reason for this is that longs are 32 bit and that is sufficient for blowfish as it works in 32 bit words. It seemed weired to me at first, its like when you do this:

But blowfish doesn’t care about the +/- part as it is working directly on the bytes in the long, thus a LONG is sufficient.

(This explanation may be off on a few technical points but you get the drift?)

I hope all the above makes (some) sense!

-brahn

A slightly fancier set of icons for use with CWPlus . I have included new icons for all the buttons on the main clarion window and a couple of updates for the window/report formatter and embeditor.

cwplus_original

Original Clarion

cwplus_standard1

Default CWPlus

cwplus_new

ClarionEdge Set

Download: download CWPlusIcons.exe
Version: 0.1
Updated: January 26, 2009
Size: 237.9 KB
Downloads: 728