Monday, August 13, 2007

Learn about HTTP-only Cookies

       If you are a webmaster and you run any sort of website that uses cookies for your users to register you will want to read this. Read this and stay tuned for my next posts if you want to learn how to make your website as safe as possible.
       XSS vulnerabilities are often used by the hackers to steal the cookies of the legitimate users. A classic method is by accessing the variable "document.cookies" using some javascripts.
       Starting with Internet Explorer 6 sp1, Microsoft has implemented a method that prevents this kind of attack. This method uses the parameter "HttpOnly" to set a cookie in the headers just like this :

"Set-Cookie: NumeCookie:value; expires=Wednesday, 10-Oct-07 23:12:40 GMT; HttpOnly"

       The key work "HttpOnly" instructs the browser of the user to restrict the access of the cookie (document.cookie) with the client-side scripts.
I will show you a method with a script javascript that can access that hidden cookie by transmitting raw requests to the web page and reading the headers.
The following code is a PHP script that shows the difference between the 2 types of cookies and how can the HttpOnly cookies be read.

       =====================
<?php
// we set a normal cookie that can be found in "document.cookie"
header("Set-Cookie: CookieNormal=valueA; expires=Wednesday, 10-Oct-08 23:12:40 GMT");

// we set a hidden cookie
header("Set-Cookie: CookieHidden=valueB; expires=Wednesday, 10-Oct-08 23:12:40 GMT; HttpOnly");
?>

<script language="Javascript" type="text/javascript">


// function that extracts the hidden cookie from headers
function unHideCookie()
{
var xhr=new XMLHttpRequest(); // creating the object
xhr.open("HEAD",document.location,true); // we set a HEAD request to the same page
xhr.send(null); //transmiting the request
xhr.onreadystatechange=function()
{
if(xhr.readyState==4)
{
if(xhr.status==200) // if we get the correct answer
{
var hidden="";
var headers=xhr.getAllResponseHeaders().split(" "); // we read all the headers and save them on each element of the i variable
for(i=0;i0) // when we find a hidden cookie
{
var cookie=headers[i].substring(headers[i].indexOf(" ")+1,headers[i].indexOf(";")+1); // extracting "name=value;"
hidden=hidden+cookie+" "; // adding the extracted cookie
}
}
//using the saved cookies in the hidden variable
alert("Hidden Cookie: "+hidden);
}
}
}
}

alert("document.cookie: "+document.cookie); // displaying visible cookies
unHideCookie(); // displaying Hidden cookies

</script>

       =====================

       The Http-only method used to hide the cookies from the client-side scripts is used for the moment just by Internet Explorer and Mozilla but it will be implemented on other browsers as well in the near future.



Open full post here

Configuring the system without the annoying warning messages for Windows Vista and changing the size of the symbols on the desktop

       Configuring the system without the annoying warning messages

       After the installation, you want to make some modifications to the system. You are being annoyed by the fact that you get warning messages constantly and every action you make must be confirmed twice. You can temporarily close User Account Control in order to configure the system without the annoying warning messages. Reactivate the control in the same way you will deactivate it, following these steps. There are 2 options to close it: first is to double click on "User Accounts" and then on "Switch on or switch off user account control" in the Control Panel. Confirm the process by clicking on "Next". Then deactivate "Use user account control to contribute to the protection of the computer" and confirm that with "OK". All you need to do afterwards is to reboot your computer, procedure that can be initiated directly from the dialog window. You can also activate and deactivate that function within "msconfig". In order to do that, type "msconfig" in the search field from the start menu and press "Enter". Click on "Tools" tab. Select "Disable user account control" and click "Start". Restart your computer.

Quick Note: User Account Control increases the security of the system and prevents unauthorized installation of different software and any changes in the system. If you shut down this function, not even safe mode from Internet Explorer will not work.

       Changing the size of the fonts on the desktop

       Vista displays very large symbols on the desktop. Users that are used to have a crowded desktop full of icons of programs that they are working with rather enjoys small icons. The size of the icons can be easily changed. In order to do that, click on desktop. Hold down CTRL button and move the wheel of the mouse in any direction. Vista will change the displayed symbols dynamically.

Note: The process works even within Windows Explorer.



       5 applications that will make your Windows XP look like Vista

       For all those who cannot afford to install Vista on their computers or just want to wait or just can't drop on the old friend Windows XP, i have thought to offer you a few applications to "dress up" your XP to look like Vista:



1. Copernic Desktop Search
The search options of Windows Vista are fast and far more complex same as those offered by this application. The categories of files search: e-mails, files, music, images, contacts, Internet Favorites and History will allow you to find anything as fast as possible. Creating and saving of the searches is now very easy to make, and the function "while you type" is also extremely useful. Copernic Desktop Search examines Microsoft Word, Excel, PowerPoint, PDF files and also other kind of files like e-mail messages, video clip files and also image files. It can search specific types of documents or even words included in this documents. The application uses an index of the files from the computer in order to return almost instantaneously results, updating automatically when the system is not busy with other tasks. The last version of this application is installed automatically into the taskbar as a separate toolbar. For any inadequate options you have installed, right click on an empty portion from the taskbar, select Toolbars and choose Copernic Desktop Search.


2. Desktop Sidebar Vista
This application offers a sidebar that provides a calendar, a calculator, a quick link to the media player and also RSS feeds. Desktop Sidebar is built from different components and each of them can be separately configured. It offers similar options that can be improved with a files browser, a weather forecast, a news program and with an e-mail checker. It also integrates controls for Windows Media Player, the QuickLaunch taskbar and many others. You can also configure its layout and its design. It can also be displayed all the time or to be hidden when it is not utilised.







3. Vista Start Menu SE
This application represents an alternative for the standard Windows Start Menu offering a different layout, made to help us access more effectively our applications without having to access more menus. You can open a program or access a document without lifting your fingers from the keyboard. The zooming options helps a lot those who own large screens or just use high resolutions. It also supports navigating in the tabs.



4. Visual Task Tips
Folders, applications, web pages, all this windows from taskbar will now be displayed in thumbnail style when the mouse is positioned above them. This is an easy option and also a lot useful especially for those who use the mouse pretty often.



5. Folder Maker
This program is a batch tool that will allow you to create a large number of folders and files very easily. It has an option to count all this as well as prefix and suffix options that will allow you to personalize the names in order to categorize them more effectively.


Open full post here

Wednesday, July 18, 2007

Adoble Flex - introduction notes

      In my first post I've spoken about some of the differences between Html and Flash. I am going to spend some time presenting to those of you who have not heard about the Flex product, some of the capabilities of the Flex 2.
      The Flex products line provides with the next generation of Developers Tool to build and deploy RIAs (Rich Internet Applications)on the Flash platform. Flex is an umbrella term for all the technologies of the Flex Product line that help developers to be extremely productive in RI Applications development. Flex allows you to create expressive content with effective interfaces, and deploy applications threw a well distributed, high performance cross-platform, cross-browsers run time environment.
      The Flex product line contains:
      *Adobe Flex Builder 2
      *Adobe Flex SDK
      *Adobe Flex Data Services 2
      *Adobe Flex Charting 2
      Adobe Flex Builder 2 is a completely new integrated development environment also known as an IDE for the Flex Framework 2, which provides coding, debugging and design tools and takes advantage of the industry leading Eclipse Tool Framework. Flex Builder 2 can install as a Standalone product, or add functionality to an existing Eclipse 3.1 installation.


It can also be used alone to develop and deploy Flex applications or can be used in conjunction with Flex Data Services. Flex Builder has a built-in compiler to create swf files from MXML and Action Script code.
      The Adobe Flex SDK provides a skeleton of the application that developers can use to extend the Flex framework which consists of prebuilt components, and these prebuilt components can be extended, or developers can build their own components from scratch.

      A highly comprehensive component framework is included within the SDK to help facilitate this. There is also a rich class library based on Action Script 3 that embodies best practices for building RIAs. The Flex SDK also contains and XML based language called MXML that provides a great way to build and layout applications as well as an the scripting language called Action Scipt 3. A compiler is also included in the Flex SDK creating swf files from your MXML and Action Script 3.

      In order to start a Flex application, the web browser will request a swf file, which is then downloaded to the client. The developers able to compile a swf file by laying out their application in the MXML language and using Action Script 3 for any logic. Action Script 3 is a class-based language that is as close to Java as you can get without actually being Java. Once the compiled swf is downloaded to the client, the swf itself can then request additional resources from the server using either Http, Soap or an Adoble protocol known as The Action Messaging Format(AMF).
      The Adobe Flex Data Services 2 add enterprise messaging support and greatly enhanced data services architecture the Flex SDK. Data services also gives you the ability to share data among multiple clients and offer support for client to client data communication. You can also push data out of the Flex Client using Data Services which gives you the ability to create sophisticated applications that displays real-time data such as sports or stock data. Flex messaging allows whole new categories of applications like data push and collaborations based applications to be delivered to the browsers in a reliable and scalable way.
      The foundation of the Rich Internet Application is the Flash Player or the Flash Virtual Machine. Flash Player 9 has been for Flex and is the backbone of the Flash platform. Of course Flash player 9 is fully backwards compatible with all of the other versions of Flash player as well. Flash Player 9 supports Action Script 3 which is a completed object pointed scripting programming language. It is a new optimized Action Script Virtual machine(AVM2) uset to execute the new Action Script new code which is significantly faster than the earlier versions. It has full run time error reporting, unlike earlier versions that were failing. There is industry standard debugging that contain stronger compile-time checking and mini new elements have been added including E4X which treats XML as a native data type, regular expressions and a brand new event model based on W3CDom events standard.
      My conclusion is that if you consider moving on and leaving HTML behind, it worth's a lot looking at this program, especially if you want to develop a rich Internet application like an e-commerce website or a website that highly interacts with the users. It has great features included and i will detail some of them on my next posts. If you also like to you can visit the Adobe website for more details.


Open full post here

Sunday, July 15, 2007

Transformers: the Movie -review-

      I didn't have much interest in seeing Transformers, but watching the trailers, I've immediately realised it will have all sort of special effects. Some of my friends said they will skip this movie, so i conformed to it, and watched the movie all by myself at a late hour so no ray of light would penetrate my windows to reflect on my computer screen, and only because i wanted to enjoy the special effect of this movie.
The huge visual effects movie Transformers racked up the biggest July 4th single-day gross in box office history, $26 million, beating the $22 million of Spider-Man 2 in 2004. By the end of the week Transformers stood at a whopping $153 million.

      Some of the most important actors in any giant robots film are, of course, the giant robots. The alien robots hide in plain sight by transforming themselves into ordinary-looking machines. The conversion process, from cars and planes to biped robots, is mesmerizing and convincing. Director Michael Bay kept throwing the robots back to ILM demanding they look more real. He wanted the robots absolutely photo-realistic. The robots look amazing, whether flying through the air, burrowing through the sand, or running down the highway. While the robots had to be created digitally, Bay prefers using real tanks and airplanes over faking it using blue screen visual effects. The military gear is expensive and there’s lots of it, lots more than Apocalypse Now. It’s the biggest military coordination with a motion picture ever.

      From what i have read about this movie, it took approximately 38 hours for the animators Industrial Light & Magic to render one frame of the CGI animation to portray the Transformers. This breaks the record set by Weta Workshop for The Lord of the Rings: The Two Towers (2002), where it took 20 hours to animate a frame of CGI to portray the Ent Treebeard.
This definitely means something, but i am really curious if it was harder to render then the scenes with the Sandman from the Spider Man 3. I know for sure that it's is extremely hard to simulate sand on an animation. For example, the people working at Spider Man 3, they had a team working for 2 years on understanding the sand particles principles and emulate those on computer. Can't beat that !
      Even though it was supposedly written by Transformers fans, the script was lacking. Since the focus is on the humans, Optimus Prime & co. are little more than scenery; nice-looking eye candy of scenery, but scenery nonetheless. And few films have such shameless product placement as Transformers does; at least 30 minutes of the film could be removed and used as a car commercial. Most characters are poorly developed or poorly written to begin with, especially the Transformers themselves. Their dialogue is hopelessly cheesy; and not good action-movie cheesy, these lines are cringe-worthy.

      A friend asked me what my favorite part of the movie was and I said "Megan Fox." Few actresses today, of any age, have the looks that she does at nineteen. She was the cast's highlight, even among all of the big names like Jon Voight and John Turturro, because few of the actors, as talented as they are elsewhere, here just don't seem to want to put out the effort needed: we have the robots, right? Why act? The same mentality doomed the Star Wars prequels.

      Overall, I'd say this was one to miss. Nearly everyone involved has something better available on the table, and Transformers fans will always have the original cartoon and comic book series.

      The Tools


      Transformers uses six Meridian Avids on Unity with about 2 terabytes of storage. A Nitris is used for all screenings including their preview. There are three main edit rooms, a fourth system in a closet, the assistants have two systems, and director Michael Bay has one. There’s a Media Net hook-up used for daily transmissions between ILM and Bay.

“For 3d modeling ILM used mostly Maya, 3ds Max, Zeno and zBrush,” says Farrar. “For lighting and rendering we use Zeno with RenderMan and Mental Ray. For compositing it's all Shake along with our Sabre systems, and editing uses Avids.”

      The Visual Effects

      There are about 630 visual effects shots in the film. There are 430 executed at ILM, 91 at Digital Domain, 70 at the Asylum and the rest are 2D clean up and fixes done by CO3, ISolve and Ken Blackwell. Technical advancements were made in environments, lighting, and simulation of physical effects and integration of CG characters in a real environment.

      “ILM did the bulk of the 3-D robots,” notes Scantlebury. “Incredible work, given the pressure of turning in shots up to the last minute…hold on…we just ordered two more 3-D shots three weeks before final delivery. Digital Domain picked up the rest, including turning a soft-drink machine into a crazed aluminum
can shooting Robot.”
      “Overall, the most challenging shot is OH020 which is a 360 degree descending camera move on Optimus that rotating around to reveal all four Autobots transforming in an alley”, says ILM visual effects supervisor Scott Farrar. “The shot was filmed in two separate camera moves from two separate rigs: a Russian arm mounted to a camera car and a 50-foot Technocrane. The plates were combined and blended. The 768-frame-long shot moves from an overhead medium close up on Optimus finishing his transformation, into an extreme close up of all the moving parts, then widening out to reveal our hero talent. Shia and Megan watch all four robots individually transform with their own unique style.”

      Challenges in 5.1 Music Editing

      Quicktimes for the sound and music department were output via a firewire connection from a DVCAM deck into Final Cut Pro. “At a certain point we were called upon to screen the movie repeatedly and without notice, with a 5.1 soundtrack,” says Rubell. “We had a 5.1 temp but were making complicated picture changes around the clock. There was no time to get back to the stage to update the tracks. So I conceived of a way to make changes and screen 5.1 out of the Avid. We mixed down the 24-track stems into their respective left, center, right, surround, and low-frequency families. We then group-clipped the individual stems with their mixdowns. We edited with the mixdowns, and when it came time to screen, we expanded back to 5.1 by switching the grouped mixdowns back to their component stems. We then mixed the stems down into a 5.1 configuration and exported that to the Nitris. It worked flawlessly, except that after a few weeks of endless group-clip switching my crew threatened to kill me. I was forced to shelve the system until Avid comes up with a way to globally switch, from mark-in to mark-out, the clips on a given audio track.”


Open full post here