User Management Code
  Home arrow User Management Code arrow Ever Changing Dynamic Passcode Code
The Best Selling PC Migration Utility.
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Forums Sitemap 
Dedicated Servers  
Download TestComplete 
IBM® developerWorks
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
IBM Developerworks
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
USER MANAGEMENT CODE

Ever Changing Dynamic Passcode Code
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2004-03-24

    Table of Contents:

    Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    Route your faxes to your email inbox. Private, secure fax numbers available from CallWave. Choose your fax number.

    This code allows you to use a changing passowrd based on the day of the week and a present code. Good security in a pinch.

    By : drastik

    <?
    // This page creates a changing password scheme that uses a simple 7 number code that
    // changes based on the day of the week. For instance, on monday you would increase the
    // first of the seven integers by one, on tuesday you would increase by two, on wendsday:
    // increase three, and so on through sunday.
    // The php code checks this against you schema of passcodes for each day and determines if
    // you have entered the code correctly.

    // Given that PHP has a great deal of flexibility in the movement oand find replace
    // functions for objects in an array, you can use this code as a starting point to develop
    // your own codes. The code above is not unbreakable, a good history buff might even know
    // the code itself, but a brute force attack could crack it. Of course, if you are using
    // integers, increasing the number of ints will make it ore difficult to crack.

    // This code is designged to work like a keypad where no user id is required. You could
    // build in userid functionality in your prefeered method (database, textfile, etc) or
    // create a code for usernames as well! I've left this part out for the sake of brevity.

    if (isset($_POST['passcode'])) { // run the functions if a post is enterd

    // This is the passCode function set
    $passCode = $_POST['passcode'];
    $passCode = explode(".",$passCode); // break the post nto an array
    $passCode = array_sum($passCode); // sum the array

    // This is the checkCode function set
    $baseCode = "8.3.0.4.4.2.1"; // Usualy this is a phone number, easy to remember
    $codeArr = explode(".",$baseCode); // array the baseCode

    // These functions determine the changes to the code based on the day of the week
    if (date("D") == "Mon") {
    $codeArr[0] = $codeArr[0] + 1;
    }
    elseif (date("D") == 'Tue') {
    $codeArr[1] = $codeArr[1] + 2;
    }
    elseif (date("D") == 'Wed') {
    $codeArr[2] = $codeArr[2] + 3;
    }
    elseif (date("D") == 'Thu') {
    $codeArr[3] = $codeArr[3] + 4;
    }
    elseif (date("D") == 'Fri') {
    $codeArr[4] = $codeArr[4] + 5;
    }
    elseif (date("D") == 'Sat') {
    $codeArr[5] = $codeArr[5] + 6;
    }
    elseif (date("D") == 'Sun') {
    $codeArr[6] = $codeArr[6] + 7;
    }

    // bring the changed baseCode numbers back into an array
    implode($codeArr);
    $sumCode = array_sum($codeArr); // sum that array
    if ($sumCode == $passCode) { //check sums for equality
    print "Access Granted";} // do whatever once you authorize
    else { print "Access Denied!"; }
    }

    else { //if no post is entered, print the code box
    print "Enter code as integers seperated by periods.";
    print "<form action=\"$PHP_SELF\" method=\"post\">";
    print "<input type=\"password\" name=\"passcode\" />";
    print "</form>";
    }

    ?>

    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More User Management Code Articles
    More By Codewalkers

     

    IBM® developerWorks developerWorks - FREE Tools!


    NEW! Applying lean thinking to the governance of software development

    Effective governance for lean development isn’t about command and control. Instead, the focus is on enabling the right behaviors and practices through collaborative and supportive techniques. Hear from Scott Ambler on how it is far more effective to motivate people to do the right thing than it is to force them to do so. Learn how to form a lightweight, collaboration-based framework that reflects the realities of modern IT organizations.
    FREE! Go There Now!


    NEW! Cook up Web sites fast with CakePHP, Part 1: Adding related information and services

    CakePHP is a stable production-ready, rapid-development aid for building Web sites in PHP. This "Cook up Web sites fast with CakePHP" series shows you how to build an online product catalog using CakePHP.
    FREE! Go There Now!


    NEW! Cook up Web sites fast with CakePHP, Part 2: Bake bigger and better with CakePHP

    CakePHP is a stable production-ready, rapid-development aid for building Web sites in PHP. This "Cook up Web sites fast with CakePHP" series shows you how to build an online product catalog using CakePHP.
    FREE! Go There Now!


    NEW! Hello World: Learn how to install and use the Rational Asset Manager Eclipse client

    In this tutorial, you can learn how to install and configure the IBM Rational Asset Manager Eclipse client, explore the different views in the Asset Management perspective, learn various search techniques, work with existing assets, and submit a new asset.
    FREE! Go There Now!


    NEW! Improve your build process with IBM Rational Build Forge, Part 2: Automate builds for a real-world Tomcat project

    Learn how Rational Build Forge can extend a simple compile and package build process by adding customization and deployment capability. Go from a manual method to automating: checking for code changes; getting the latest source; compiling and packaging; customizing; copying to and restarting a deployment server; and sending e-mail notification that a new version is available.
    FREE! Go There Now!


    NEW! Spot defects early with Continuous Integration

    Continuous Integration (or CI) is a process that consists of continuously compiling, testing, inspecting, and deploying source code. In many Continuous Integration environments, this means running a new build anytime code within a source code management repository changes. The benefit of CI is simple: assembling software often greatly increases the likelihood that you will spot defects early, when they still are relatively manageable. In this tutorial, a companion to his series In pursuit of code quality, Andrew Glover introduces the fundamental aspects of Continuous Integration and steps you through how to set up a CI process using best-of-breed open source technologies.
    FREE! Go There Now!


    NEW! Trial download: IBM Rational Functional Tester V7.0.1

    Get a free trial download of the latest version of IBM Rational Functional Tester V7.0.1. Rational Functional Tester is an automated functional and regression testing solution for QA teams concerned with the quality of their Java, Microsoft Visual Studio .NET, and Web-based applications.
    FREE! Go There Now!


    NEW! Trial download: IBM Rational Tester for SOA Quality V7.0.1

    Get a free trial download of the latest version of IBM Rational Tester for SOA Quality V7.0.1, a functional and regression testing tool that enables the creation, comprehension, modification and execution of testing GUI-less Web services.
    FREE! Go There Now!


    NEW! Web development with Eclipse Europa, Part 2: The Java EE for Eclipse

    No matter what combination of technologies you prefer to work with as a Web developer, Eclipse is a single integrated development environment (IDE) that can increase your productivity. In Part 2, we'll see how easy it is to develop PHP applications using a different set of Eclipse plug-ins, collectively known as the PHP Development Toolkit (PDT.)
    FREE! Go There Now!


    NEW! Webcast: Eclipse: Empowering the universal platform

    The Eclipse community is constantly working to extend Eclipse's functionality. In this webcast, learn about some of the most important and feature-rich projects under development. From multi-language support to plug-in development, tune in to see what Eclipse is capable of now.
    FREE! Go There Now!



    All FREE IBM® developerWorks Tools!

    USER MANAGEMENT CODE ARTICLES

    - XCRYPT v1.0b
    - DB_eSession class stores sessions in a MySQL...
    - Ever Changing Dynamic Passcode Code
    - phpAutoMembersArea - create own members area
    - Azura Signup 2.5
    - Azura Signup 2.0
    - Azura Signup
    - Flexcustomer
    - PHP Quicksite 2.0
    - PHP Quicksite 1.0
    - random string generator (key generator)
    - Example Login system
    - Simple and Easy Security
    - Basic Security
    - UMA - User Management and Authentication


     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway