 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Anthony Ferrara: Seven Ways To Screw Up BCrypt
by Chris Cornutt December 21, 2012 @ 12:20:04
If you're going to be rolling your own user handling in your application, no doubt you've heard that something like bcrypt-ing your passwords is a good idea. Well, Anthony Ferrara has some suggestions for you and shows you seven ways you can "screw up" when trying ti implement it.
There are numerous articles on the web about how to properly use bcrypt in PHP. So this time, rather than write yet-another-how-to-use-bcrypt article, I'm going to focus on the mistakes that are commonly made when implementing bcrypt.
Here's the list of seven ways (each has its own description in the post):
- Using A Non-Random Salt
- Using An Incorrect Random Source for Salt Generation
- Using Too Weak Of A Cost Parameter
- Using The Wrong PHP Version
- Using The Wrong Prefix
- Not Checking For Errors
- Not Using A Library
He also includes two "bonus" things to consider: "Not Using A Timing Safe Comparison" and "Not Encoding The Salt Correctly".
voice your opinion now!
bcrypt screwup implementation suggestion salt random prefix library
Devis Lucato's Blog: Select Inversion of Control
by Chris Cornutt December 14, 2011 @ 13:34:53
In a recent post to his blog Devis Lucato introduces the "Inversion of Control" design pattern and shares an implementation he's created as an illustration - a Service Locator called Select.
[In a Service Locator] all the dependencies are provided by a builder, which serves as a registry of dependencies and/or service definitions. The service locator knows how to instantiate each dependency. Such service exposes methods like 'getMailer()', 'getLogger()' etc. A service locator centralises the configuration detailing classes and parameters involved on objects instantiations.
He includes some sample code showing the structure of a Select implementation using a "Mailer" identifier and definitions of the classes to load for it. He also includes a bit of documentation of the (simple) API you can use to work with the tool - setting namespaces, replacing class definitions, creating definitions and finding the resource associated with a definition (to name a few).
voice your opinion now!
inversion control designpattern select implementation
DZone.com: Java PHP Python -- Which is "Faster In General"?
by Chris Cornutt January 07, 2011 @ 12:17:55
On the Java DZone.com section today there's a "which is faster" post comparing PHP, Java and Python. No, it's not quite what you're expecting - I'd suggest reading on.
Sigh. What a difficult question. There are numerous incarnations on StackOverflow. All nearly unanswerable. The worst part is questions where they add the "in general" qualifier. Which is "faster in general" is essentially impossible to answer. And yet, the question persists. There are three rules for figuring out which is faster. And there are three significant problems that make these rules inescapable.
His three rules are:
- Languages don't have speeds. Implementations have speeds.
- Statistics Aren't a Panacea.
- Benchmarking Is Hard.
He seems to hit most of the issues with these sort of "faster" posts up front and notes that, while benchmarks can be run on a lot of different aspects about the languages, the results depend on how you slice it. His suggestion is, instead, to not try to compare the languages in a grand sense. Take each of them and compare them on specific tasks and let those results stand alone. Each of the three languages is going to be better at something than the other two.
voice your opinion now!
benchmarking python java faster implementation
Developer.com: Quercus Bring Java's Power to Your PHP Development (and Vice Versa)
by Chris Cornutt August 27, 2010 @ 09:30:58
On Developer.com today there's a new tutorial about Quercus - the Java-based implementation of PHP - and how to get it up and running in your environment.
Imagine the possibilities when a PHP developer can continue using the language's templating capabilities while leveraging Hibernate's object-relational features. Thanks to an open source project named Quercus, PHP and Java developers alike can mix and match the respective capabilities of both languages. [...] This approach (part of the movement that software architect Neal Ford famously defined as "polyglot programming") opens up a whole new world of opportunities for developers seeking to squeeze every last ounce of performance and capability from their application platforms.
They help you get it installed and show you how to execute a PHP script from inside. There's also a bit about integrating Java libraries into your code and the integration of a type of tool PHP doesn't come native with, something like iTextPDF.
voice your opinion now!
quercus java integration implementation polyglot mix
Elizabeth Smith's Blog: My five (well four and one-half) issues with namespaces
by Chris Cornutt September 09, 2008 @ 08:46:35
Even with the release of PHP 5.3 looming closer and closer on the horizon, there's a few things that are still being worked through - one of which is the much touted namespace support. Elizabeth Smith has posted a few of the issues that she's having with how they're being implemented, four and a half of them, to be exact.
The first thing to clarify is that I like the new implementation overall, it's fairly light and although it isn't really namespacing or packaging in any sense of the word, the best way to describe it is aliasing, it does help keep code easy to use. In fact I have a couple of projects and even a PHP extension that's all namespaced code.
Her list of five (four and a half) things are:
- multiple namespaces in a file
- you can't have ANYTHING before the namespace statement but an opening <?php tag
- The autoload and resolution paths
- Functions in namespaces
- No use * and three million use statements (this is the one with the workaround - class_alias)
voice your opinion now!
issue namespace implementation multiple autoload function use
Alexey Zakhlestin's Blog: FastCGI in PHP - The way it could be.
by Chris Cornutt June 11, 2006 @ 13:26:04
Alexey Zakhlestin shares with us in this new blog post, how the fast-cgi PHP developers think they're using isn't really a true FastCGI.
Most PHP programmers believe, that PHP has support for FastCGI. They refer to fastcgi-sapi, which is bundled with php since long ago, and which was recently reimplemented for PHP 5.1.3/4. This SAPI really does exist and actually working quite good. But… it is not a real fast-cgi. It is just an imitation of mod_php which is linked against fastcgi api, instead of apache api. So, it's time for you to ask: if it exists and works, then what am I talking here about? Let's start from the basics...
He talks about a history of how things go to where they are, starting back with regular CGI scripts, moving up through using server-based APIs, and finally to FastcGI, a method for overcoming a lot of the limitations of its predecessors.
With that look back, he turns his attention around and looks to the current situation within PHP. He talks about the sudden appearance fastcgi made in PHP's SAPIs, but that the implementation wasn't true. He suggests that the reasoning behind this "fake" implementation was for the sake of speed. He also notes, however, it's his opinion that true FastCGI support in PHP will be a requirement for future large-scale applications.
voice your opinion now!
fastcgi sapi fake implementation fastcgi sapi fake implementation
|
Community Events
Don't see your event here? Let us know!
|