8051 authentication system
Discussion in "8051 Discussion Forum" started by rearthur2003 Jun 15, 2009.
Mon Jun 15 2009, 02:22 am
you can give it a try
Tags 8051 uart based authentication systemuart access system
#include "uart.h" #include "uart.c" void delay_rony(unsigned int delay_val) { int temp = 0; do { temp++; } while(temp<=delay_val); } void main(void) { //int i; unsigned char usr1, usr2, usr3, usr4, usr5, pass1, pass2, pass3, pass4, pass5; while(1) { uart_init(); start: uart_string("******************************\n\r"); uart_string(" 8051 AUTHENTICATION SYSTEM \n\r"); uart_string("******************************\n\r\n\r"); delay_rony(50000); uart_string("Username: "); usr1 = uart_receive(); uart_send(usr1); usr2 = uart_receive(); uart_send(usr2); usr3 = uart_receive(); uart_send(usr3); usr4 = uart_receive(); uart_send(usr4); usr5 = uart_receive(); uart_send(usr5); if(uart_receive() == 0x0d) { if(usr1==0x61&&usr2==0x64&&usr3==0x6d&&usr4==0x69&&usr5==0x6e) { uart_string("\n\r"); goto passwd; } else { uart_string("\n\r\n\rInvalid User!!!\n\r"); goto start; } } else { uart_string("\n\r\n\rYOU HAVE EXCEEDED MAX NUMBER OF CHARS. \n\r"); } } passwd: uart_string("\n\rPassword: "); pass1 = uart_receive(); uart_string("*"); pass2 = uart_receive(); uart_string("*"); pass3 = uart_receive(); uart_string("*"); pass4 = uart_receive(); uart_string("*"); pass5 = uart_receive(); uart_string("*"); if(uart_receive() == 0x0d) { if(pass1==0x61&&pass2==0x64&&pass3==0x6d&&pass4==0x69&&pass5==0x6e) { uart_string("\n\r\n\rACCESS GRANTED\n\r"); } else { uart_string("\n\r\n\rInvalid Password!!!\n\r"); goto start; } } else { uart_string("\n\r\n\rYOU HAVE EXCEEDED MAX NUMBER OF CHARS. \n\r"); } uart_receive(); }
Mon Jun 15 2009, 04:19 am
Hello rearthur2003
Thanks for the post.
Could you explain a bit more about how your program is used ?.
Thanks for the post.
Could you explain a bit more about how your program is used ?.
Mon Jun 15 2009, 06:56 am
This works with serial port on baud rate 4800 once connected to you will need to authenticate yourself before doing anything, it can be added to uart based code. username is admin and password is admin. hope you like it.
Tue Jun 16 2009, 07:49 pm
good work
Why dont you make an application using this code, will be a good project and can help others too

Why dont you make an application using this code, will be a good project and can help others too

rearthur2003 like this.
Tue Jun 16 2009, 10:45 pm
i am working on it, i am working on something to control doors lights in the home so i can do everything from my pc so i dont get interrupted. anyways thanks for the comment
Powered by e107 Forum System