Posts categorized “REALbasic”.

Notes from the States – Day 4: REAL World First Day Proper

So yesterday was the first day of the whole reason I’m here, REAL World 2006 Users Conference.

As usual my body clock still thinks that 04:30 is actually 10:30, so I woke up and couldn’t get back to sleep as much as I tried. Didn’t help when the room next door’s (there’s a locked adjoining door) alarm clock went off at 06:00, and then had two phone calls. So much for the early night and sleep through to 07:30. By the end of the week I might just be adjusted to this time-zone as I leave for home!

Knocked off a couple of support requests and stuff before heading down to registration. Saw Aaron Ballman in the restaurant getting grilled by a small group, so joined in! Learnt a few juicy things about input handling and the things they have to go through to ensure REALbasic works on the many different keyboards out there. Also confirmed some stuff I wanted to know about the IDE’s code editor, there’s functionality there that may one day be relevant to CaseDetective.

At registration got my t-shirt and badge like everybody else and then got stuck in to the pastries and coffee that was available, glad I didn’t order breakfast before, those pastries were yummy, I love that French custardy stuff who’s name I always forget (confectionary custard?). Briefly chatted to Brad Rhine, and saw many faces that I recognize from their blogs or from RBDeveloper profiles.

The keynote for me was all about one announcement, soon there will be the ability to save our projects out to multiple flat text files, so we can use any version control we fancy and get proper diffing and individual modifications tracking! Woohoo! There were a lot of cheers for that one.

But there were plenty of other things in the keynote:

* New regional REAL Software offices, e.g. European and Chinese offices.
* Over 100,000 customers so far, aiming much higher for the future.
* Stuff coming in RB2006r2 and later:
> Localization of IDE
> MySQL plugin supporting latest versions
> Support for Oracle Instant Client
> Improved ODBC
> Even better VB compatibility (e.g. With statement, Currency datatype, improved VB conversion)
> SSL Socket with proxy support (tracking OpenSSL)
> Plugin API for datatypes
* Definitely after RB2006r2:
> Mac Intel (Universal Binary)
> Compile to Cocoa, which means using standard edit field and therefore enabling in-built auto-complete, spelling and full contextual menu etc, core graphics and proper composite windows with optimized clipping and refresh and so on, all standard controls will use Cocoa base where possible but retain current RB functionality
* RB apps already work fine with Windows Vista (theme savvy)
* Swordfish … still working on it
* REAL SQL Sever
> One database engine, one source of support for your customers
> Easy to install and use (just drag binaries onto computer and run, has monitor app, backup etc)
> RB plugin, C and PHP clients (with more to come)
> it’s fast, across suite of tests was 2x faster than PostgreSQL, 4x faster than MySQL

My notes aren’t complete, there was plenty of other market information and other nuggets of information. I should warn that as my notes aren’t complete I may have got things wrong too, so take everything above as pure rumour and not fact.

Lunch was nice, met some great people and had some good discussions about many things, which is a theme that has repeated throughout my time here. Meeting people that I know from the NUG or forums or people I’ve never heard of before has been extremely valuable, the things you learn from just a 2 minute conversation can be very very enlightening.

After lunch I attended Aaron’s “A Deep Look At Threads” session. Great session, even though I’ve read the stuff on his blog and bought the two threading articles from RBLibrary.com I still learnt a couple of things, or rather had a couple of ideas verified by his talk and questions posed by other attendees. I really know the difference between preemptive and cooperative threading now, and why we’re really lucky to have cooperative.

Then I attended Jon’s “Mastering Declares” session, which for me was the best of the day. He succinctly explained how to construct declares and his examples were great. It was particularly useful when he showed how to use the new structures functionality with declares, and when he showed how easy it was to use an array in a structure I was over the moon! I just need to make sure I get the example code he wrote off him, I’ll have to chase him down for that stuff.

The final (2 hour) session I attended was the Cocoa one, where Jon showed off the Cocoa functionality that he’s been working on for almost a year now. Really good stuff, not particularly applicable to what I’m doing just now but very interesting all the same.

My mind was too frazzled to attend the coding contest, so I just did a bit of email and started to write this post before going down for dinner and drinks.

As mentioned earlier, these social situations are where attending these conferences really shows it’s worth. During the evening I got to chat, have a beer with and play pool with people that I never imagined I’d ever meet, people who’s products I use and were more than happy to discuss features, how they achieved them and many other technical and plain interesting things. It wasn’t all techy, it’s nice to just chat about life too.

It was a great evening that finished just past midnight for me, falling very quickly into deep and very needed sleep.

Notes from the States – Day 3: Short but sweet.

Sunday 26th Feb 2006 was a nice relaxed day.

In the afternoon I just wandered around Austin taking in the quiet Sunday scene. Had a bit of food and coffee to clear the hang-over and then headed back to the hotel once the blisters started to appear.

Room hadn’t been cleaned yet, so grabbed my laptop and sat down in the lobby to catch up on the news and stuff with the slightly quicker ‘net connection down there.

Met a few like-minded REAL Worlders there, so had a couple of nice little chats as people came and went.

Later, after getting another shower to shed off the last of the hang-over went down to the bar and met up with some other REAL Worlders again, and then went out for a great steak at “Ruth’s Chris Steakhouse”. Very nice, had a good conversation about various subjects ranging from colour-spaces to the differences between the various States of America.

When we got back met up with a load more REAL Worlders, including Aaron Ballman and Mars Saxman, but I was really shattered so only stayed for about half an hour before heading off to bed.

Short day, but really nice, looking forward to meeting more people today. Talking of which better get off to Registration and breakfast.

Speak to you later!

Notes from the States – Day 2: History, beer 'n' boobs!

I couldn’t sleep. As much as I tried I eventually awoke at 06:30 am and couldn’t get back to sleep, even thought I didn’t go to sleep until after 00:30 the night before.

So, I eventually got up, showered, shaved, and made my way out to the lobby to settle my bill (zero, all paid via Expedia.co.uk earlier).

After a short ride by a really nice man driving the Hilton courtesy bus back, went back to the airport to pick up a Super Shuttle into Austin to the Omni hotel and dropped off my bags as I was a little too early to check in.

I then took a nice stroll around town, getting completely lost. It’s real strange seeing street names sign-posted across the entrances to totally other streets when you’re used to streets being sign-posted on the side of buildings actually on the street!

I eventually found (with the help of a nice gentleman outside a bar) the Visitors Information centre. From there I worked my way up to the Capitol building and had a look around. Impressive building, it’s strange how open it is for people to just wander around (obviously you can’t go into the private offices).

I then followed a self-guided walking tour, looking at all the buildings and stuff. Part way through I stopped off at a deli and had a sandwich and coffee. It was a fantastic sandwich, Pastrami and Swiss on Jalapeño Cheese bread, probably the tastiest sandwich I’ve ever had. Yum.

It started to drizzle mid afternoon so I headed back to the hotel and checked in, where I was warned that it’s Mardi Gras weekend, so if things get a little too loud to give them a call.

Once into my (nice) room checked my mail and posted my previous entry via the (free but slow) wireless internet. When I first got into the room though, the phone rang, I thought it might of been Dr Gerard Hammond whom I had planned to meet up with later, but it was someone very different and totally unexpected, Mandy my wife!

She was a little worried as she hadn’t heard from me in two days! For me of course it was only a day and a half, it was only mid afternoon but for Mandy it was late night. Anyway we had lovely chat (I guess it probably cost a fortune), it was great to be able to talk to Mandy.

Met up with Gerard in the hotel’s atrium bar, where we had a few beers and a good chat about REALbasic, the community surrounding it and some other stuff, then decided to go out and get something to eat and check out some of the live music.

When we came out of the hotel and turned the corner to go down to 6th street where all the action is, I was surprised to see that the police had closed the road to all traffic. There were police everywhere! All the streets leading to 6th were blocked off by police cars, and all up and down the street were little groups of police with some very long batons hanging off their belts. Serious stuff, I guess things can get a little out of hand on Mardi Gras weekend then, or do they do this every Saturday night?

We checked out a few restaurants and then headed into one that first took our fancy. Good food, I enjoyed my Chicken Chipotle, but Gerard had a bit of a shock when he opened the napkin in the bread basket, cockroaches on the bread! Eeewwww! The waitress was also a little shocked too, and very embarrassed and apologetic, we got a free sweet as compensation.

So off to check out the music and get one last drink (we had already had 5 or six beers so far).

It kind of looked as though things were getting set up for a parade, but when Gerard asked a girl selling beads about it she said no, “just beer ‘n’ boobs”!

It was just before 9pm, and things were only just starting to come alive, eventually we came across “Bourbon Rocks” which seemed to be bouncing with life, a band in full swing knocking out some great rock. “All beers $2 until 9″ the guy on the door said, so we got in there quick as it was 5 to 9 and got our cheep beers.

The band was excellent, great music and the lead singer was putting on a great show, so we stayed for “just one more” beer. And then another, another, another, another and then a few more!

I must apologize to Gerard at this point, I think I encouraged him to stay for “just one more” a little more than I should, but in all fairness he did surprise me a couple of times by saying “lets have just one more” himself.

The band even played some Led Zeppelin at my request too, they really knew how to play, the lead guitarist got a nice little workout with that request!

And of course, with this being Mardi Gras, the band got the occasional flash of boobs!

Eventually we came to our senses and wandered back to the hotel, although I got a bit confused and headed off in the wrong direction at first, convinced we had to cross the street. It didn’t look right, but I was convinced I was going in the right direction. Eventually we asked a police man what direction the Omni was, and he just pointed up at the huge tower with Omni written on it, a block or so behind him! I still thought it was the wrong direction but decided to give it a go! I think maybe I was a little drunk. :-)

Now I’m paying the price for all those beers. It’s looking like a really nice day outside, but I’m not looking forward to the bright light!

I won’t be drinking like that again this week, I want to enjoy and get the most out of the conference and therefore can’t afford to have a hang-over spoiling it. But I had a blast last night, it was a great time to be out and about in Austin.

Notes from the States – Day 1: I had to take my shoes off!!!

Wow, US Homeland Security is serious stuff, flying to the USA involves many security checks, which I guess in the end I’m quite thankful for.

2006-02-24 06:40 GMT: As I queued in Edinburgh to check in for my flight to New York – Newark, the first of three flights to get me to Austin Texas for REALWorld 2006, I was given the third degree like never before.

We’re all used to being asked “did you pack your bag yourself?”, “has anyone given you anything to carry on the flight?”, “Have you got anything sharp in your hand luggage?”. But I wasn’t expecting “Who owns these bags?”, “Where did you pack your bags?”, “Where have your bags been since being packed?”, “Have your bags ever left your sight?” and a couple of others I can’t remember.

Then as I was checking in I was asked whether security could search my bag as part of a random check? First time I’ve ever had my main luggage bags searched, in over 9 years of frequent flying around the World (on a couple of occasions literally around the World, on my travels to New Zealand and back). Wasn’t an ordeal, the guy was very nice about it and very gentle with my kit, we had a nice chat actually, apparently he was in “the force” and had a torch similar to my mini maglight, but bigger. When all was done I locked my bag up and the security guy put my bag onto the belt of an empty check-in desk, I must admit I was a little worried that it would be forgot and wouldn’t make it to Newark.

The flight from Edinburgh to Newark was fine, pretty uneventful until we got close to our destination and started our descent when we met the worst turbulence I’ve ever had the misfortune to experience. Scary s$*t, we had a real rough ride there, and had some spectacular drops. You should of heard the screams, I’ve only heard anything like it while watching some crappy airplane disaster movie or something. At first I was laughing it off, but towards the end after a few sudden drops as we neared the runway I wasn’t smiling any longer, in-fact I don’t mind admitting that my hands were gently wringing the life out of the arm wrest!

After kissing the ground on exiting the plane, onto US Immigration. I’ve only been through US immigration twice before, both times were excruciatingly slow, hot and very tiring. This was nothing like that. I queued for maybe five minutes and then I was up (a new guy on came shift and I switched across and was third in line). Got the finger print and picture thing done, and then the usual “business or pleasure?” (actually it was just “here on business?”, he’d read my visa waver card), “what do you do?” etc. And then “have you been to the States before?”, my answer “yes, a couple of times.”, and then he asked the trick question … “When was the first time you visited?”. Had to think about that one, it was quite a while ago, “1998″. “Thank you, have a nice stay!”. Pretty painless really, much better than last time.

Waiting for my bags was a little nervy, fingers and toes crossed in hope that my bag made it onto the flight. Bags took a while to come out, no surprise there, seemed to come in waves, I guess as they were unloaded from each of those little trucks you see scooting around on the tarmac. First wave of bags came and went, mine wasn’t there. Second wave came and went, no sight of my Samsonite. Third, no bag (getting a little nervous now), fourth, oh dear. Long wait. Is that it? Surely not, there’s still about twenty groups here still. Wait some more, bugger. Fifth arrives, and mine is first! Thank [insert preferred descriptive expletive here, something like "goodness" will do]! :-)

Through customs (apparently that consists of just queuing and handing them your customs card), and then I need to find where I drop off my case for the trip through to Austin (via Cleveland). Easy, couldn’t miss it. Nice lady checked the tag on my case and said “Just give it to that guy to put on the belt, it’s unlocked right?”. Eh? “You must unlock your case, just scoot over there and unlock it and then give it to the guy.”. I’m surprised at this, obviously this is so that the bag can be searched, it wasn’t just my case, I heard her ask everyone, but this really goes against the grain for me. In the U.K. we’re used to being told to make sure your case is locked so that it can’t be tampered with. Got no choice, and I’m not going to argue about it, so just step aside and unlock it, open and close each latch to make sure it really is, and then pass it onto the guy who out it on the belt. Fingers crossed again that those latches don’t spring open in transit and I lose all my loosely packed socks and shorts or something. Don’t relish the idea of going commando!

Now I go up to the departure gates area and wait in a long queue to go through security. Had my Boarding Pass and Passport checked twice while waiting, as did everybody. Moved pretty quick really considering what you find when you arrive at the scanners. I usually get sorted for the scanner nice and early, I empty everything from my pockets, wallet, loose change, gadgets, put them in my bag and then take off my coat, but I didn’t expect … “All males over the age of 16 must take off their shoes” was shouted out, “… or else you will be searched.“. “All laptops must be removed from bags and placed in a separate box.“. Why were only blokes asked to take off their shoes and put them through the scanner? Why not women too? I don’t get it, although I understand why it’s a good idea to have them put through the scanner (I saw Aeon Flux the other day, O.K. bit of entertainment but she had stuff hidden in her shoes, no man did from what I remember). I guess, in the end, it does make me feel quite a bit safer to see this kind of thing happening, it’s a pain, but better safe than sorry I say.

After that it’s been nice and calm. Had really nice service in the Garden State Diner (where I had a Philly Cheese Steak Sandwich, yummy), and even had one of the same stewardesses from the flight to Newark on my flight to Cleveland, which was nice, small World really isn’t it?

While I waited for my flight to Cleveland I caught a few of the endless CNN “loops”, it was quite strange to see some stuff about home on the news, i.e. the £40 Million robbery and something about the Mayor of London’s suspension for his concentration camp comment to a Jewish reporter. There was also something about Bono and Geldof being nominated for Nobel Peace prizes or something. It was hard to tell what was being said on the newscast as every other sentence was interrupted by airport announcements, but I did see a piece about some “eighty year old” driving for 14 miles the wrong way down the freeway, in the fast lane, which was quite funny.

It’s now 19:40 EST (00:40 GMT) and I’m now sitting in the departures lounge in Cleveland waiting for my flight down to Austin. My seat makes a “ffft ffft ffft” sound every time I move, a bit like some unfortunate harnessed beast from Star Wars complaining as it gets a heel in it’s side, and “Jody Maroni’s Sausage Kingdom” is smoking the place out. I’ve had a nice Raspberry, Strawberry and Low Fat Dairy Mix “All That Raz” smoothie (my first ever proper smoothie), and am considering wandering off to get a Starbucks.

I’m not going to submit this post just now as I’d need to pay for wireless access, but I will as soon as I get to somewhere with free internet access. I think I’ll post more “notes from the States” throughout the week, if anything just as something to look back on later, but also so that family and friends can see what I’m getting up to as well. I’ll try and write at least one post per day.

Ta-ta for now!

Update 19:54 EST (00:54 GMT): Got my Starbucks, my usual “Americano” (after much experimenting over the years I’ve settled on good old simple coffee), and boy they’re stronger over here (or maybe it’s just because that’s what I need just now)! Me likes.

Update 23:55 CST (05:55 GMT): Made it to Austin, with case and everything!

Flight from Cleveland was pretty smooth, didn’t even realize we’d actually taken off it was so smooth and I was reading about Yao the Houston Rockets 7 foot six inch tall Chinese basketball player in the in-flight magazine. Tiny little plane, but nice and quick on and off it.

Walked through the airport to baggage claim and as I came to the carousel my case popped up into sight from the chute, how jammy is that! First thing I did? Move to the side and pop my case open to check everything was there. Not sure my case was searched, one of the internal detachable side pockets was off it’s hooks and the batteries for my alarm clock were no where to be seen (later found down opposite sides of the case), but everything looks to be there. Sigh of relief.

Spending the night in the Hilton at the airport, nice big room, usual fair for a Hilton. Rather tired, been awake for nearly 25 hours now, time to crash (can say that now that I don’t have any more flights for a few days)! Night night.

UNIX Crypt For RealBasic

A little while ago I mentioned that I had initially built the user authentication in CaseDetective so that it used the user’s FogBugz website to do an automated physical login, and then parsed the resulting page for specific variable names that can only be there if the user had logged in successfully. This was a bad idea, and not even my preferred method, but I’d done this way to avoid asking Fog Creek about the encryption they use for user passwords stored in the database. Anyway, once I wised up and asked Michael Pryor if he’d let me in on the secret, he of course told me that it was the UNIX Crypt algorithm (funnily enough, I’ve recently found a discussion forum post where he had already mentioned it, but it was after I released Beta 1).

I was over the moon when Michael told me it was UNIX Crypt because I figured there’d be thousands of ready made modules that I could choose from that would give me instant access to the one-way crypt I needed, it’s so old, so ingrained in the UNIX world that it was surely going to be a breeze.

So I checked out my Einhugur plugins only to find no simple “UNIX Crypt” functions. Not worry, there are a tonne of different algorithms in the e-CryptIt module, it’s probably just down to me not knowing what the underlying cryptographic algorithm is, so I search the net…

I spent a few hours searching the net, eventually finding out that UNIX Crypt is a derivative of the Data Encryption Standard (DES). I learnt a lot about encryption in these few hours, including that UNIX Crypt is pretty weak, but also that it’s pretty easy to password check with because the “salt” is embedded in the encrypted string as the first two characters. I also leant that in a lot of systems the DES algorithm has been superseded by using Blowfish or Twofish.

Back to my plugins … nope, nothing about DES, not a sausage. Bugger! So I sent an email off to the Einhugur list asking if I was right, maybe I’d missed something, but alas, DES and UNIX Crypt are not supported by e-CryptIt, and no-one knew of another plugin that would help. Double bugger! At least e-CryptIt has Blowfish and Twofish, but that doesn’t help me just now as I need the DES version.

There are very few modules out there (”out there” being the internet) that do UNIX Crypt, and most are for Windows and would require that I bundle another dll with my application, which I really didn’t want to do, I already bundle the eSellerate dll and didn’t want to have to bundle any more.

Even if I did buy a dll (most of these dll files require payment) and distribute it for Windows, it would still have left me with having to find a solution on Mac OS X.

I played around with RealBasic Declares on Mac OS X as it comes with a “unistd” library that I found I could potentially call to do a crypt. But I had very sporadic results, and many crashes, and relying on the placement of a library outside of my control gave me the hebees (you’re supposed to be able to just use the sort name for the library without it’s full path, but that never worked for me, I had to use the full path to get anywhere at all).

What next, write my own UNIX Crypt module from scratch, in RealBasic? Surely not, that’s got to be painful!

Well, I had no choice, I either wrote a module to do UNIX Crypt from within my RealBasic application where I had full control and no cross-platform woes, compile up some freely available C code for both Windows and Mac OS X, keep searching fruitlessly for an existing robust cross-platform solution (that isn’t there), or forget the whole thing and go back to looking at building Integrated Windows authentication into my FogBugz web logon code (shivers with dread).

During my research on the web I found various bits of C code that did DES and UNIX Crypt that had BSD or other unencumbered licenses, so I had at least some code I could look at for inspiration. Now, I’m no C coder, I can read it a bit as long as it doesn’t get too hairy, and I’ve even written a few modules and applications for clients where we needed to wrap third-party libraries with C code, and then in some cases wrapped this with Informix 4GL code. I’ve had some great success with that kind of thing. But I’m telling you now, people that devise encryption algorithms are seriously deranged, how on Earth they come up with this stuff beats me, and how some of these C developers got to the place where they do certain things they do I don’t know. It’s just plain scary looking at encryption code.

I’d found via Wikipedia.org a great DES Algorithm Illustrated page (WARNING: if you go to that site, don’t bother looking at other parts unless you’re in the privacy of your own home as your boss may not appreciate the scantily clad ladies) that explained bit by bit (literally) how the DES algorithm worked with a known input and output. Without that site I’d have been right royally stumped, it allowed me to build a stand alone project in which I could test my UNIXCrypt module with a known input and output not only to the entire algorithm, but to each little segment of the calculations.

It took a few days, and a lot of hair loss, but eventually I had straight DES working fine, I could perfectly replicate the inputs and outputs from DES Algorithm Illustrated. Woohoo!

All I had to do then was implement UNIX Crypt. Sounds easy don’t it? I thought so too. The problem is that UNIX Crypt doesn’t use straight DES, oh no, that would be too easy, it has to be mucked about a bit first! ;-)

UNIX Crypt sets the DES key in just the same manner as normal DES does using the string (password) passed in. So far so good. Then it runs DES encrypt 25 times using that key, but starting off with a message containing just zeros. This also sounds pretty straight forward doesn’t it? Well, on each of those 25 runs of DES crypt, at each point that the “E-Box” is expanded (you’ll have to go look at that DES Algorithm Illustrated site to see what that means) the resulting bits (which by the way have already been mucked about enough thank you very much) are mucked about again depending on some XOr criteria derived from the two “salt” characters.

Luckily I had various bits of C code to check out, but they don’t really explain anything, and try as I might I just couldn’t get the bloomin’ thing working.

I tried for two weeks to get UNIX Crypt working, it was so frustrating. I had DES working, I knew it, so why could I not get these seemingly small changes to adhere to the UNIX Crypt algorithm working?! I think I must have lost at least half my hair over those two weeks (that’s my story and I’m sticking to it, I haven’t been losing my hair at all before that, not one ;-) ).

Finally I sent out a plea to the RealBasic Network Users Group (NUG) for anyone who knows any way of getting UNIX Crypt working reliably cross platform from RealBasic. I was prepared to throw all my work away if anyone came up with anything good. No one had suggestion that would work for me, it seems no one on the group had needed to do it before cross platform, although there was a Mac OS X solution for encrypting passwords.

Eventually a guy called Mark Nutter found some Java code I hadn’t seen before that did UNIX Crypt, I looked at it and found that it very closely matched the C code I’d used as a template for my own development. I followed it through and compared to my own RealBasic code, just like I had the C code, but alas could not find anything that looked wrong.

When I reported back to the NUG that I still couldn’t find the problem Mark then offered to take a look at my code to see if anything jumped out, so I took him up on his offer and sent him my test project. Later that day he wrote back, unfortunately not having been able to find the problem. Here’s a quote from his email:

… I’m checking your RB code against that, and
everything seems to check out, except that the results
aren’t matching. But encryption algorithms are so
twisted! My brain hurts after only a couple hours, I
can imagine you’ve been going bonkers.

At this point I’m fairly stumped also. :(

I wrote back thanking him for trying and telling him not to try looking at it any more, I didn’t want to be held responsible for his decline into madness! I’d just have to try and step through the code bit by bit and see if I can find the place where it went astray.

When Mark wrote back to say good luck he casually mentioned that I should try and compile up the C code I’d used as a template and output to a buffer every now and then and compare with my RealBasic code. Doh! Why the hell didn’t think of that sooner, I had code that I knew should work, tried and tested, but just in another language.

So I jumped into XCode created a new project and copied in the C code I’d been using and set about creating a command line app that would simply print out the bit strings at various points. I started off by making it simply do the UNIX crypt to make sure it was doing the right thing, outputting the input and output strings. It worked.

Then I decided I’d start off slowly, I just added one intermediate output of a “bit string”, the bits as accepted by the setkey function which is called right at the beginning before doing the real DES stuff. Then did the same in my RealBasic code. Ran the two of them, and guess what, I already had a miss-match! Bugger, bugger bugger! If I had a problem this early on in the process, it was going to take me bloody ages to find and fix all the other errors.

When I looked closely at the two bit strings, that should have been the same, but weren’t, I noticed that my code was creating a string very similar, in fact it was almost identical except for an extra “0″ at the beginning of the string, and then again before the next recognizable pattern of “1″s and “0″s. Damn, my code was passing in 8bits per character rather than the 7bits per character for the key that the C code was using. Checked my code, sure enough, there it was, an extra “0″ in my bit mask when converting the ascii characters to binary!

Oh well, delete one “O”, recompile and run again to find the next error. Except there wasn’t an error, my test project only bloody went and spat out the correct encrypted string! Woohoo! Do a little jigg!

It only took me a couple of minute to import my UNIXCrypt module into my CaseDetective project and hook it up to get it working, finally I could authenticate a user’s FogBugz login id and password against the database, cross platform and without any dependance on external modules or applications. Phew, I can’t tell you how much of a relief that was, I was so happy.

So, after all that hard work, fretting and nearly going insane, I’m going to do one last insane thing, I’m releasing my UNIXCrypt RealBasic module as a free download. You can grab it from my IMiJ Software website, it’s in the “Free Stuff” section.

You can download or check out the UNIXCrypt REALbasic module and test project that I created from the rbunixcrypt Google Code project. It’s under a MIT license, so you can do pretty much anything you like with it.

You can use the UNIXCrypt RealBasic module to simulate UNIX Crypt by simply calling “UNIXCrypt” with a string and two character salt.

Thank you to everyone who helped or tried to help me get this done, hope someone finds it useful.