PHP Table class is a simple but powerful table renderer that consists of data aquisition and rendering components. It allows you to easily display the results of an SQL query or a PHP array as a formatted HTML table with stylesheet support, ordered columns, and numeric totals. A powerful class inheritance method provides a great deal of flexibility. It is also possible to output tab-separated records.
PHP Comment Class is a simple, reusable comments engine which utilizes the PHP Table and Form classes. Backing into a MySQL database (or any other persistent store provided by Table or Form), it provides a set of Form and Table children which, when called, generate a comments engine with input validation and stylesheet support.
Not quite as strong
You may have already considered this, but "resetting" the encryption I assume means returning to the IV generated from the passphrase. If you do this every 8k for example, you provide any attacker with a large set of similarly produced ciphertexts. In addition, every 8k block that is equal will encrypt to the same value allowing the attacker to make inferences about the contents of the file from the prevalence of particular encrypted results.
I'm not convinced either of these issues is a particularly big deal in this case, but it might be worth noting somewhere prominent that block ciphers are chained for these exact reasons, and that the user should understand that the resulting encrypted file is not as strong as one produced normally. I think it's more than fair to say (assuming you're using a decent cipher :) that it is still plenty strong enough for regular data, although I'd be worried about anything that someone might take a few months to try and break.
sign()
Ok, first up, props to the person who thought up that sign() stuff. It's a neat hack.
Second, I'll hang the developer who uses it in any code I have to go near :) No offense, but I'll burn any reasonable number of CPU cycles in return for code that reads intuitively, and that stuff really really doesn't.
Unless you're outputting the result directly, doing a translation from a multiple key array to a pivot format is a trivial transformation in any programming language with associative arrays. In addition, transform solution is subkey-independant (your pivot example relies on their only being 4 exam types, new exam types would require query rewrites).
And quite frankly it reads better. The query now becomes trivial:
$exam_result_by_name = $db->getAll("select ln,fn,exam,sum(score) from exam group by ln,fn,exam",array(),DB_FETCHMODE_ASSOC);
// Keyed transform to pivot.
foreach ($exam_result_by_name as $row) {
$pivot[$ln][$fn][$exam] = $row['score'];
}
And while it is arguable that the sign method is more efficient in CPU usage (although I'd like to see some hard writeup about that), it is both (IMNSHO) less readable and less maintainable.
Rest of the article is most useful. Thankyou!
A tool for securing DNS communications between a client and a DNS resolver.