<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CrankBerry Blog &#187; Web Security</title>
	<atom:link href="http://www.crankberryblog.com/category/web-security/feed" rel="self" type="application/rss+xml" />
	<link>http://www.crankberryblog.com</link>
	<description>Sharing ideas on web design, development and the internet economy</description>
	<lastBuildDate>Thu, 22 Apr 2010 21:46:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Secure PHP login without database</title>
		<link>http://www.crankberryblog.com/2009/secure-php-login-without-database</link>
		<comments>http://www.crankberryblog.com/2009/secure-php-login-without-database#comments</comments>
		<pubDate>Fri, 23 Oct 2009 22:55:09 +0000</pubDate>
		<dc:creator>Jerry Low</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Security]]></category>
		<category><![CDATA[PHP Script]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.crankberryblog.com/?p=143</guid>
		<description><![CDATA[Although not recommended but maybe for some reason you need to create a PHP login without the use of any database (SQL). For some reason you maybe scared to approach, but here I made a script that is fairly secure without utilizing any database at all. It allows users to login and stay logged in. If you are one of those people then here's the script for you. ]]></description>
			<content:encoded><![CDATA[<p>Although not recommended but maybe for some reason you need to create a PHP login without the use of any database (SQL). For some reason you maybe scared to approach, but here I made a script that is fairly secure without utilizing any database at all. It allows users to login and stay logged in. If you are one of those people then here&#039;s the script for you.</p>
<p>Now this script does not use any external files to store user names and password as it opens up more security flaws for hackers, so everything is managed in an array within the PHP. If somebody was able to get a hold of your PHP file this will compromise things but the chances of that happening is fairly close to utilizing a database. </p>
<p><strong>Features</strong></p>
<ul>
<li>Utilizes cookies to give users ability to stay logged in across multiple pages</li>
<li>Secure login algorithm mitigates hacking attempts</li>
</ul>
<p><strong>Drawbacks</strong></p>
<p>Now by not utilizing a database there are some drawbacks and they are:</p>
<ul>
<li>Users cannot change password and user names manually</li>
<li>Users can attempt login as many times as they want</li>
</ul>
<p>With that said, it means that usernames and passwords must be managed by an admin. If this is still something for you. If this is not for you wait around because I will convert this script into a database version in the future.</p>
<h3>Less Talk More Script</h3>
<p>Installation:</p>
<p>Just download all the necessary files which includes:</p>
<ul>
<li>_login.php</li>
<li>_login_page.php</li>
<li>_login_class.php</li>
<li>_login_users.php</li>
<li>login.php</li>
<li>logout.php</li>
</ul>
<p>Once you put these in your root folder you need to edit the users and settings. Open up _login_users.php and you&#039;ll see:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">&lt;?php</span></p>
<p><span class="co1">//My Login Script</span><br />
<span class="co1">//Attach this to any page that requires Login</span></p>
<p>
<span class="co1">//Users and Settings</span><br />
<span class="re0">$domain_code</span> = <span class="st0">&#039;website&#039;</span>;&nbsp; &nbsp; &nbsp; &nbsp;<span class="co1">//Alpha Numeric and no space</span><br />
<span class="re0">$random_num_1</span> = <span class="nu0">20</span>;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Pick a random number between 1 to 500</span><br />
<span class="re0">$random_num_2</span> = <span class="nu0">565</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Pick a random number between 500 to 1000</span><br />
<span class="re0">$random_num_3</span> = <span class="nu0">3</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Pick a random number between 1 to 3</span></p>
<p><span class="co1">//Usernames can contain alphabets, numbers, hyphens and underscore only</span><br />
<span class="co1">//Set users below &#8211; Just add &#034; =&gt; &#034; with the first &#034; being</span><br />
<span class="co1">//the username and the second &#034; after the =&gt; being the password.</span><br />
<span class="co1">//Its an array so add an , after every password except for the</span><br />
<span class="co1">//last one in the list. As shown below</span><br />
<span class="co1">//Eg. $users = array(</span><br />
<span class="co1">//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;user1&#039; =&gt; &#039;password&#039;,</span><br />
<span class="co1">//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;user2&#039; =&gt; &#039;password&#039;</span><br />
<span class="co1">//&nbsp; &nbsp; &nbsp; );</span></p>
<p><span class="re0">$users</span> = <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#039;user1&#039;</span> =&gt; <span class="st0">&#039;password&#039;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#039;user2&#039;</span> =&gt; <span class="st0">&#039;password&#039;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span>;</p>
<p>
<span class="kw2">?&gt;</span></div>
<p>Modify the domain code and three random numbers. The three random numbers is the key that makes login <em>secure and unique</em> to your website only. Then at the bottom you can create all of your users.</p>
<p>Now in every page that you require the user to login just add the following code to the very top of the page, exactly on line 1.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">&lt;?php</span> <span class="kw1">require</span><span class="br0">&#40;</span><span class="st0">&#039;_login.php&#039;</span><span class="br0">&#41;</span>; <span class="kw2">?&gt;</span></div>
<p>That&#039;s pretty much all you need to do to install the secure login script. The only other thing if you want is you can edit _login_page.php. That&#039;s the page people see when they need to login.</p>
<p><strong>Login and Logout</strong></p>
<p>You can lead users to login and logout with links to login.php and logout.php as such.</p>
<div class="dean_ch" style="white-space: wrap;">&lt;a href=&quot;login.php&quot;&gt;Login&lt;/a&gt; | &lt;a href=&quot;logout.php&quot;&gt;Logout&lt;/a&gt;</div>
<p><strong>Displaying Macors</strong></p>
<p>In this case the only macro you can call up is the username after they have logged in. You can call it in a welcome back message like this (placed in your HTML).</p>
<div class="dean_ch" style="white-space: wrap;">Welcome back <span class="kw2">&lt;?php</span> <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="re0">$login</span>-&gt;<span class="me1">username</span>; <span class="kw2">?&gt;</span></div>
<p><strong>Download the files:</strong><br />
<a href="http://www.crankberryblog.com/files/php-login-without-database.zip">PHP Login Without Database.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.crankberryblog.com/2009/secure-php-login-without-database/feed</wfw:commentRss>
		<slash:comments>36</slash:comments>
		</item>
		<item>
		<title>What is SSL and do I need SSL?</title>
		<link>http://www.crankberryblog.com/2009/what-is-ssl-and-do-i-need-ssl</link>
		<comments>http://www.crankberryblog.com/2009/what-is-ssl-and-do-i-need-ssl#comments</comments>
		<pubDate>Sat, 26 Sep 2009 23:42:17 +0000</pubDate>
		<dc:creator>Jerry Low</dc:creator>
				<category><![CDATA[Hosting Server]]></category>
		<category><![CDATA[Web Security]]></category>

		<guid isPermaLink="false">http://www.crankberryblog.com/?p=141</guid>
		<description><![CDATA[<div class="excerpt_screen_right"><img src="http://www.crankberryblog.com/images/what-is-ssl-thumb.jpg" alt="What is SSL and do I need SSL?" /></div>A lot of web developers or webmaster today over AND undermines the importance of SSL (Secure Socket Layer), not solid state drive (if you're in the wrong article the back button's located on your toolbar). SSL is a security feature or function to enhance the overall user experience and trust. In this article I will briefly explain what SSL is, how its used and if it is right for you.]]></description>
			<content:encoded><![CDATA[<p>A lot of web developers or webmaster today over AND undermines the importance of SSL (Secure Socket Layer), not solid state drive (if you&#039;re in the wrong article the back button&#039;s located on your toolbar). SSL is a security feature or function to enhance the overall user experience and trust. In this article I will briefly explain what SSL is, how its used and if it is right for you.</p>
<p>So as we know the internet, we open up our favourite browser (Internet Explorer, Firefox, etc.) and we type in a website and BAM! we arrive at the website full of information. For this article I&#039;ll say there&#039;s three components in this situation &#8211; the browser, the website AND the connection between the both of them. When it comes to security over the internet all three of these components must be secured.</p>
<p>As a web developer or webmaster you are responsible for two of these components: the website and the connection. The browser resides in the user&#039;s computer so they have to take the proper measures to secure that (anit-virus, trojan, spamware blah blah blah). For you, the website requires a lot of things to be secured and we&#039;ll leave this for another discussion.</p>
<h3>Three Paragraphs and Still No SSL Talk Yet</h3>
<p>So the remaining component here is the connection. SSL&#039;s responsibility is to encrypt/secure the data transmitting between the browser and the website. Image this, you have a client who&#039;s trying to shout to you his credit card number, 100 meters away, in a busy mall. Neither your client or you is comfortable with this (well you might be if you&#039;re that type of person). If you had a real life SSL in this situation it would work like this. Everybody in the mall speaks English, so SSL will translate what your client is saying into French and emit it. You don&#039;t have to understand French because SSL will translate it back to you. So eventhough you&#039;re yelling sensitive information, nobody can understand what is being said except you and your client.</p>
<p>The internet now-a-days is not just about getting content. Its about interactions between users and websites or users and users. If a hacker is sitting at the connecting listening (sniffing) the information they can hear everything you&#039;re saying. Yes, they can hear everything from your credit card information to your secret crush in the next cubicle. Having a certified SSL connection means that security is tighter and mitigates anything like that from happening.</p>
<p>Note: How can you tell if the site you&#039;re on has SSL implemented? Websites with SSL implemented will lead you to a website starting with HTTPS://. Just look at the URL right now as Crankberry Blog doesn&#039;t have SSL it just says HTTP://. Not only does the site need to have HTTPS:// they also need to have to have the proper certificate. Your browser will tell you if they do or not. Here are some examples of certified SSL pages through different browsers.</p>
<p><img src="http://www.crankberryblog.com/images/what-is-ssl-ie7.jpg" alt="What does SSL look like in IE7" /><br />
Internet Explorer 7</p>
<p><img src="http://www.crankberryblog.com/images/what-is-ssl-ff.jpg" alt="What does SSL look like in Firefox" /><br />
Firefox</p>
<p><img src="http://www.crankberryblog.com/images/what-is-ssl-chrome.jpg" alt="What does SSL look like in Chrome" /><br />
Chrome</p>
<p><img src="http://www.crankberryblog.com/images/what-is-ssl-safari4.jpg" alt="What does SSL look like in Safari 4" /><br />
Safari 4</p>
<h3>Do I need SSL</h3>
<p>Here you are developing your website and wondering if you need SSL on your site. Well ask yourself these questions. Do you have any user interaction? Is your interactions sensitive? If your answers are yes then you would most likely need SSL. If your site is people discussing about their secret crushes or how much people should FMyLife then you shouldn&#039;t be too concern. In addition, if you have users signing up for accounts, how much would be compromised if their account information gets in the hands of a hacker? Sometimes people sign up for accounts with real and sensitive information while sometimes they just give out a bogus alias. Here is a list of some examples where I believe SSL is required, not required or borderline.</p>
<p>Required</p>
<ul>
<li>Online Banking</li>
<li>Payment transfers</li>
<li>Classified postings with transaction information</li>
<li>Government websites</li>
<li>Employment information sites</li>
<li>Company intranets</li>
<li>Email accounts</li>
<li>Auction sites</li>
</ul>
<p>Not-Required</p>
<ul>
<li>General Forums</li>
<li>Blogging</li>
<li>Commenting systems</li>
<li>Guestbooks</li>
</ul>
<p>Border-line</p>
<ul>
<li>Social networking</li>
<li>Exclusive Forums</li>
</ul>
<p>So there you have it. A general outlook at what SSL is and how it may help you. If you were looking for something more technical, by this point you may have already been disappointed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crankberryblog.com/2009/what-is-ssl-and-do-i-need-ssl/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
