Hack Forums
[Shell] [SHORT SCRIPT] Secure Login [SHORT SCRIPT] - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Shell] [SHORT SCRIPT] Secure Login [SHORT SCRIPT] (/showthread.php?tid=2730625)



[SHORT SCRIPT] Secure Login [SHORT SCRIPT] - Quantum Batch - Jul 31, 2012

Just thought I would share my secure login script. It has no key and won't accept spaces or an special characters. As this is my first attempt, feel free to leave a comment about a bug or an improvement that can be made.

PHP Code

<?php 
@ECHO OFF
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
:HASH_ENCRYPT
SET 
/P "ENCRYPT_INPUT=Password: "
SET COUNT=0
SET STEPPING
=10
:CPX_REF
SET START
=0
FOR %%H IN (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9) DO (
    IF 
"%%H" == "!ENCRYPT_INPUT:~%COUNT%,1!" (
        
SET /A HASH=!STEPPING:~0,1!+!STEPPING:~1,1!
        IF !
HASH! GEQ 10 (
            
SET /A HASH=!HASH:~0,1!+!HASH:~1,1!
        )
        
SET CPX=!CPX!!HASH!
        
CALL :CPX_SALT
        SET 
/A COUNT+=1
        SET 
/A START=1
    
)
    IF 
"!START!" EQU "1" (
        
SET /A STEPPING+=1
    
)
)
IF 
"!ENCRYPT_INPUT:~%COUNT%,1!" NEQ "" (
    GOTO 
CPX_REF
)
ECHO 
Password hash is: !CPX!
PAUSE
GOTO :EOF
:CPX_SALT
SET 
/A PAD=!STEPPING! %% 36
SET ALPHA
=ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
SET CPX
=!CPX!!ALPHA:~%PAD%,1! 
GOTO :
EOF 



* - Johnny Cache - Sep 17, 2012

Really nice script, but what string do i use for the password-input and check?