Category Archives: Tutorials

Using Bcrypt with Spring Security

4
Filed under Hibernate, Java, Software, Spring Framework, Tutorials

Password security is a popular topic. The most basic tenant of password security is to have no password at all. Wait, what? That’s right, no password should be stored in your database, ever. Instead, store it as a hash, along with the salt, and throw the original password away. Ask 10 different developers, and I’ll bet that MD5 would be offered as the most popular solution for this problem. Though, if you’ve explored the linked content, you’ll have undoubtedly noticed that Bcrypt is mentioned more than a few times.

“Bcrypt is a cross platform file encryption utility. Encrypted files are portable across all supported operating systems and processors. Passphrases must be between 8 and 56 characters and are hashed internally to a 448 bit key. However, all characters supplied are significant. The stronger your passphrase, the more secure your data.”

For us Java developers, there’s jBCrypt. It is an “implementation of OpenBSD’s Blowfish password hashing code” and offers a rather simple API. A quick web search yields a bit of information on using jBCrypt itself, but nothing on integrating it with the Spring Framework. Given that this is a topic of interest to me, I’ve put together a simple, yet comprehensive example web application to demonstrate an integration of jBCrypt, Spring MVC, Spring Security and Hibernate for hashing user passwords. There are three areas I’ve focused on in this example, user creation, user authentication and changing the user’s password. Read More »

Server-side stream recording example updated

43
Filed under ActionScript, Flash, Java, Red5, Software, Tutorials

With this being my most popular blog topic, I felt the time has come for a little update. (You can catch up on the original here.) Frankly, there’s not much too it. The server-side code didn’t change much, just an update to take advantage of the built-in logging support of Red5. Both clients have been completely rewritten using ActionScript 3. (I know, it’s about time.) Read More »

Red5 + Hibernate Revisited

17
Filed under Flash, Hibernate, Java, Red5, Software, Spring Framework, Tutorials

It’s hard to believe that I wrote the first version of this tutorial almost a year and a half ago. That’s too long to wait for an update in my opinion and is much needed in this case. My apologies for not tending to the garden sooner. While the original article illustrated a simple method for integrating Red5[1] and Hibernate[2], by today’s standards it’s design is overly verbose and somewhat out of fashion. Not to mention the 3 major components used in this tutorial have all gone through major revisions. The primary goal for this iteration was simplification of the code as well as the XML configuration elements and results in a smaller code footprint. This is a big win in my book. Read More »

Flickr style multiple file upload with jQuery

15
Filed under ActionScript, Flash, Software, Tutorials, jQuery

A while back, Paul Gregoire introduced me to the jQuery JavaScript library. It didn’t take long for me to realize the power and elegance of this library. For the longest time, I’ve been wanting to take a shot at authoring a plugin for jQuery and I’ve finally gotten around to it. So, it is my pleasure to announce the creation of the jquery.transmit plugin. It is a flash-backed multiple file upload utility with a user experience similar to that of Flickr’s current uploader. The goals for the plugin were simple: Provide an easy-to-use interface, use flash to work around HTML and JavaScript based file upload issues, and wire it all together with jQuery. Getting started with the plugin is quite simple. Import the necessary CSS and JavaScript dependencies, edit the supplied HTML to your liking and invoke the plugin like so:

    $(document).ready(function() {
        $('#transmit').transmit('http://mysite.com/upload/');
    });

While the plugin is still very much in its infancy and should be considered a work in progress, it is my opinion that it is easier to shake out bugs using an iterative development process. So, keeping that in mind, I’m hoping that a couple of you brave souls will wander over to googlecode and give it a try. Constructive feedback is very much appreciated.

RESTful URLs with Spring MVC and UrlRewriteFilter

16
Filed under Java, Spring Framework, Tutorials

While Spring 3.0 promises to support REST style URLs out of the box, it won’t ship until sometime later this year. Spring 3.0 M1 will offer this functionality for anyone brave enough to work with potentially unstable technologies and should be available soon. And while this is good news for those starting out on new projects (or those willing to undergo a significant refactoring), most won’t want to migrate their applications just for RESTful URLs. All hope is not lost though, thanks to Paul Tuckey’s UrlRewriteFilter. Read More »

Remote debugging Red5 applications

12
Filed under Eclipse, Java, Red5, Tutorials

Red5[1] contributor Paul Gregoire recently added a new server startup script targeted specifically at application debugging. The script is quite simple in nature and is provided in both Windows and Unix flavors. Take note, however, that this script is exclusive to the standalone version of Red5. Debugging the WAR version of the server is quite a different task. To demonstrate the ease of debugging your applications, I’ll walk through a simple example using Eclipse[2] and the source code from my stream recording tutorial. Read More »

Server-side stream recording with Red5

66
Filed under ActionScript, Flash Media Server, Java, Red5, Software, Tutorials

This tutorial has been updated. Please check out the new post.NetStream.publish(“streamName”, “record”) API, it is sometimes useful to take FLV snippets from the publishing stream instead. In my opinion, this is one of the greatest features of Flash Media Server (FMS) and Red5. Utilizing this strategy allows the application developer to precisely control when and how much of the video is recorded. While recording via the NetStream function has been available in Red5 since the beginning, recording video from the server-side application has not. In this post, I’ll demonstrate Red5′s ability to record an FLV with a very simple pair of publish and subscribe flash applications. Read More »

Red5 + Hibernate

9
Filed under ActionScript, Hibernate, Java, Red5, Software, Tutorials

This tutorial has been updated. Please check out the new post.

Having followed the growth of the Red5 Media Server[1] from it’s fledgling 0.3 days, I’ve become fairly familiar with its offerings. One of the most frequently asked questions on the Red5 mailing list pertains to database connectivity for user authentication and application security. I’ll attempt to tackle one solution here using Hibernate[2], an object/relational persistence framework. Read More »