• We just launched and are currently in beta. Join us as we build and grow the community.

Password Security Version 2.0

saltatrenes

Open World Conqueror
S Rep
0
0
0
Rep
0
S Vouches
0
0
0
Vouches
0
Posts
57
Likes
15
Bits
2 MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1 200 XP
Password.cpp
Author : oursharingciub
Date : September 26, 2014 Firday
Email : [email protected]
Tool : Dev C++
Language : C++

Notice: Reference Mr. Jake Rodriguez Pomperada programming

  1. #include <iostream>
  2. #include <conio.h>
  3. #include <string>
  4. #include <windows.h> //system(), Sleep( )
  5. #include <time.h>


  6. using namespace std;

  7. const

    int

    PASSLEN=

    7

    ;

    //The length of password

  8. string PassGet(

    void

    )

    ;

    // Get the password
  9. void

    Menu(

    void

    )

    ;

    //The start menu


  10. //******** main function **********
  11. int

    main(

    void

    )
  12. {
  13. Menu(

    )

    ;

  14. getch

    (

    )

    ;

    //wait untill enter any key

  15. return

    0

    ;
  16. }


  17. //****** PassGet and menu function*****

  18. string PassGet(

    void

    )
  19. {
  20. char

    password[

    PASSLEN ]

    =

    {

    '\0

    '

    }

    ;
  21. char

    letter;
  22. int

    loop;
  23. int

    len;
  24. string password2;

  25. len=

    0

    ;
  26. loop=

    0

    ;
  27. letter=

    '\0

    '

    ;

  28. while

    (

    letter!=

    '\r

    '

    )

    //Caarrige return character
  29. {
  30. letter=

    getch

    (

    )

    ;

  31. if

    (

    letter==

    '\b

    '

    &&

    password[

    0

    ]

    ==

    '\0

    '

    )
  32. {
  33. loop=

    0

    ;
  34. len=

    0

    ;
  35. }
  36. else
  37. {
  38. if

    (

    letter==

    '\b

    '

    &&

    password[

    0

    ]

    !=

    '\0

    '

    )

    // \b :backspace
  39. {
  40. cout<<

    "\b

    "

    ;
  41. cout<<

    " "

    ;
  42. cout<<

    "\b

    "

    ;

  43. loop--;
  44. password[

    loop ]

    =

    '\0

    '

    ;
  45. len--

    ;
  46. }
  47. else
  48. {
  49. if

    (

    isprint

    (

    letter )

    !=

    0

    &&

    loop<

    PASSLEN )
  50. {
  51. password[

    loop ]

    =

    tolower

    (

    letter )

    ;

  52. cout<<

    "*"

    ;
  53. }
  54. loop++;
  55. if

    (

    loop<=

    PASSLEN )
  56. {
  57. len++;
  58. }
  59. }
  60. }
  61. }

  62. //Convert Password from character
  63. loop=

    0

    ;
  64. password2=

    ""

    ;

  65. while

    (

    loop<

    len )
  66. {
  67. password2=

    password2+

    password[

    loop ]

    ;

  68. loop++;
  69. }
  70. return

    password2;
  71. }

    //End of Passget function


  72. void

    Menu(

    void

    )
  73. {
  74. string password;

  75. //Get local time<code><code></code></code>
  76. time_t date;
  77. date=

    time

    (

    NULL )

    ;

  78. cout<<

    "\n

    \n

    "

    ;

  79. char

    str[

    ]

    =

    "********* PASSWORD SECURITY VERSION 2.0 **********"

    ;

  80. for

    (

    int

    i=

    0

    ;

    i<

    strlen

    (

    str )

    ;

    i++

    )
  81. {
  82. cout<<

    str[

    i ]

    ;
  83. Sleep(

    100

    )

    ;

    //wait 0.1 second
  84. }
  85. cout<<

    "\n

    \n

    "

    ;
  86. cout<<

    "\n

    \t

    \t

    Notice: Protect your Password."

    ;
  87. cout<<

    "\n

    \n

    \t

    \t

    Enter Your Password: "

    ;

  88. password=

    PassGet(

    )

    ;

  89. if

    (

    password==

    "sharing"

    )
  90. {
  91. system

    (

    "cls"

    )

    ;

  92. cout<<

    "\n

    \n

    \n

    \n

    "

    ;
  93. cout<<

    "\t

    \t

    Password Accepted."

    ;
  94. cout<<

    "\n

    "

    ;
  95. cout<<

    "\n

    \n

    \t

    \t

    Thank You For Using this Software."

    ;
  96. cout<<

    "\n

    \n

    \t

    \t

    Date : "

    <<

    ctime

    (

    &

    date )

    ;

    //show local time
  97. }
  98. else
  99. {
  100. cout<<

    "\n

    \n

    "

    ;
  101. cout<<

    "\n

    \t

    \t

    Sorry..."

    ;
  102. cout<<

    "\n

    \t

    \t

    Password Denied!!!\n

    \n

    "

    ;

  103. Sleep(

    1000

    )

    ;

  104. cout<<

    "\n

    \n

    \t

    \t

    Try Again( Y ): "

    ;

  105. char

    ch;

  106. cin>>

    ch;
  107. if

    (

    toupper

    (

    ch )

    ==

    'Y'

    )
  108. {
  109. system

    (

    "cls"

    )

    ;

  110. Menu(

    )

    ;
  111. }
  112. else
  113. {
  114. exit

    (

    1

    )

    ;
  115. }
  116. }

  117. return

    ;
  118. }

    //End of Menu Function

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.

2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.


Download
You must upgrade your account or reply in the thread to view the hidden content.
 

452,496

337,656

337,664

Top