A couple months ago, I got the TI-84 Plus CE, and started experimenting...

Using inputs, if then statements, and list commands, I tried to make a password protected program - which I jokingly called "Facebook".

I will be documenting my journey on my YouTube series. If you have any ideas for what I should add to the program, leave them down below.

In the first part of this multi-part series, I hard code a username and password management system.

EPISODE 2: https://youtu.be/DZEqGDuO8h8
EPISODE 1: https://youtu.be/QgTAEEpY1i0

PROJECT STEPS
Step 1: Hard-coded login page [Ep. 1 - Released]
Step 2: Dynamic sign-up page using lists [Ep. 2 - Released]
Step 3: Menu [Ep. 2]
Step 4: Undecided. Anything can be put behind the login wall
Step 5: Optimize and release

OTHER IDEAS
- Update a unique status
- Profile management (delete account, reset password)
- Terms of Service
- Alphanumeric usernames and passwords that work with lists
- Select programs to be accessed through Facebook
- Archive lists on program end

CHANGE LOG:
- Lists made on program start (1/29)
- Prompts replaced with inputs (1/29)

ACKNOWLEDGEMENTS
- LogicalJoe: Signup and login optimizations
- TheLastMillenial: Aesthetic changes

PROGRAM FILES
GitHub: https://github.com/EverydayCodeNet/FACEBOOK-TI-84

FULL PLAYLIST: https://www.youtube.com/playlist?list=PLNaKib3k95amx7e0v2nRJ3mu0GLfvPRWQ
Not to demoralize you, but don't you think it's a little ambitious to try to make a clone of Facebook?
mr womp womp wrote:
Not to demoralize you, but don't you think it's a little ambitious to try to make a clone of Facebook?


When I coded this for the first time, it was an ambitious project, but the fundamental code is working if you check the GitHub (the video series is not in line with the real program yet). It's also not actual internet access, so there's not much of a challenge to it, except deciding what to put behind the password screen.

I'm always open to suggestions on how to improve the project though.
I am getting an undefined error as soon as I make a new username. Probably because you have to declare the list at the beginning of the program. I would also suggest that if you use strings, usernames could be letters, too!
Ambitous project, but that's nothing unusual for Cemetech. I hope this goes smoothly for you!

Your video was pretty good! What video editing software are you using?
When your TI-Smartview trial runs out, I'd suggest using an emulator called CEmu which is free, open source, and made by some of the community members on this site.

Along with what dunlavdy said, I have a few recommendations for your code.
1. Never ever use a Goto to jump out of an If Else statement. It causes something called a Memory leak which will slow down your program and eventually crash it. Personally, I'd steer away from labels as much as you can because it can make spaghetti code pretty quick and is difficult to debug. Instead, I'd suggest using loops more.
2. For readability purposes, I'd suggest using the Input command which lets you print out words such as "Password:" then it accepts the user's input into whatever variable you want.

P.S. What's your program's privacy policy? Razz
dunlavdy wrote:
I am getting an undefined error as soon as I make a new username. Probably because you have to declare the list at the beginning of the program. I would also suggest that if you use strings, usernames could be letters, too!


Thanks for reminding me! I'm experimenting with the SetUpEditor command to automatically create the list on program start (updated now). I'm currently looking into archiving it so people can't change the password through the backend - I will update the post when that's ready.

About the strings. Since I wanted to have multiple users, I was not sure how to store each user's name as a separate string, and still be able to recall it later.

For example: Input→Str1
But, I want the next username to input into Str2

If you have any solution for that, or any other suggestions, please let me know!
TheLastMillennial wrote:
Ambitous project, but that's nothing unusual for Cemetech. I hope this goes smoothly for you!

Your video was pretty good! What video editing software are you using?
When your TI-Smartview trial runs out, I'd suggest using an emulator called CEmu which is free, open source, and made by some of the community members on this site.

Along with what dunlavdy said, I have a few recommendations for your code.
1. Never ever use a Goto to jump out of an If Else statement. It causes something called a Memory leak which will slow down your program and eventually crash it. Personally, I'd steer away from labels as much as you can because it can make spaghetti code pretty quick and is difficult to debug. Instead, I'd suggest using loops more.
2. For readability purposes, I'd suggest using the Input command which lets you print out words such as "Password:" then it accepts the user's input into whatever variable you want.

P.S. What's your program's privacy policy? Razz


I use Movie Platinum 14.0 (Sony Vegas). I'll definitely download that emulator, looks pretty versatile.

I've totally run into what you've said with the spaghetti code. One of my programs was a choose your own adventure, and using Lbls and Goto commands for that was a complete mess. I'll see what I can do!

Inputs updated!

P.S. Whether or not I make a privacy policy, I'll still sell your data Very Happy
Since I don't want to recode the whole program, I just want to focus on the password system in general: I would only use one list for "usernumbers" and passcodes.
It should look something like this: {USER,PASS,USER,PASS,USER,PASS…
To create a user, it would look just about the same:
Code:
Input "USERNAME:",N
Input "PASSWORD:",W
N->|LFACE(1+dim(|LFACE
W->|LFACE(1+dim(|LFACE
Of course, you don't want two users with the same name, so we need a check:
Code:
If max(N=seq(|LFACE(A),A,1,dim(|LFACE),2
Pause "THIS USER IS TAKEN
And it would be implemented something like this:
Code:
Input "USERNAME:",N
Input "PASSWORD:",W
If max(N=seq(|LFACE(A),A,1,dim(|LFACE),2
Then
Pause "THIS USER IS TAKEN
Else
N->|LFACE(1+dim(|LFACE
W->|LFACE(1+dim(|LFACE
Pause "USER CREATED
End

The login page is almost just as trivial:

Code:
Archive |LFACE
Input "USERNAME:",N
Input "PASSWORD:",H
UnArchive |LFACE
rand->P
N=seq(|LFACE(A),A,1,dim(|LFACE),2
If max(Ans
|LFACE(2+2dim(Ans)-2max(AnscumSum(not(0Ans->P
If H!=P
Disp "INCORRECT USER OR PASS
By archiving |LFACE during input, I prevent one from easily bypassing the password by typing in |LFACE(1 for a username and |LFACE(2 for a password. And so you don't think that this isn't a vulnerability in yours, |LUSER(1 and |LPASS(1. The other way to prevent this is to create a custom input system, which isn't hard, it just requires a bit more work.

To delete the N'th user, the following code is sufficient:

Code:
seq(|LFACE(A-2(A<=2N)),A,3,dim(|LFACE->FACE

To find a user's location in a list with name N:

Code:
1+.5dim(|LFACE)-sum(cumSum(N=seq(|LFACE(A),A,1,dim(|LFACE),2

To delete the user with the name N one can simply put the two back-to-back:

Code:
2+dim(|LFACE)-2sum(cumSum(N=seq(|LFACE(A),A,1,dim(|LFACE),2
seq(|LFACE(A-2(A<=Ans)),A,3,dim(|LFACE->FACE

If one forgot their password, we have to reset it. So they input a username, we find it in the list, and then let them overwrite the password:

Code:
Input "USERNAME:",N
Input "PASSWORD:",H
H->|LFACE(2+dim(|LFACE)-2sum(cumSum(N=seq(|LFACE(A),A,1,dim(|LFACE),2
Note: The last few routines assume that the user exists.

TheLastMillennial wrote:
… I'd suggest using an emulator called CEmu which is free, open source, and made by some of the community members on this site.
I second this, I highly recommend CEmu.

If you do plan on making a custom input system, look into the getKey command.

I look forward to your next video.
LogicalJoe wrote:
Since I don't want to recode the whole program, I just want to focus on the password system in general: I would only use one list for "usernumbers" and passcodes.
It should look something like this: {USER,PASS,USER,PASS,USER,PASS…
To create a user, it would look just about the same:
Code:
Input "USERNAME:",N
Input "PASSWORD:",W
N->|LFACE(1+dim(|LFACE
W->|LFACE(1+dim(|LFACE
Of course, you don't want two users with the same name, so we need a check:
Code:
If max(N=seq(|LFACE(A),A,1,dim(|LFACE),2
Pause "THIS USER IS TAKEN
And it would be implemented something like this:
Code:
Input "USERNAME:",N
Input "PASSWORD:",W
If max(N=seq(|LFACE(A),A,1,dim(|LFACE),2
Then
Pause "THIS USER IS TAKEN
Else
N->|LFACE(1+dim(|LFACE
W->|LFACE(1+dim(|LFACE
Pause "USER CREATED
End

The login page is almost just as trivial:

Code:
Archive |LFACE
Input "USERNAME:",N
Input "PASSWORD:",H
UnArchive |LFACE
rand->P
N=seq(|LFACE(A),A,1,dim(|LFACE),2
If max(Ans
|LFACE(2+2dim(Ans)-2max(AnscumSum(not(0Ans->P
If H!=P
Disp "INCORRECT USER OR PASS
By archiving |LFACE during input, I prevent one from easily bypassing the password by typing in |LFACE(1 for a username and |LFACE(2 for a password. And so you don't think that this isn't a vulnerability in yours, |LUSER(1 and |LPASS(1. The other way to prevent this is to create a custom input system, which isn't hard, it just requires a bit more work.

To delete the N'th user, the following code is sufficient:

Code:
seq(|LFACE(A-2(A<=2N)),A,3,dim(|LFACE->FACE

To find a user's location in a list with name N:

Code:
1+.5dim(|LFACE)-sum(cumSum(N=seq(|LFACE(A),A,1,dim(|LFACE),2

To delete the user with the name N one can simply put the two back-to-back:

Code:
2+dim(|LFACE)-2sum(cumSum(N=seq(|LFACE(A),A,1,dim(|LFACE),2
seq(|LFACE(A-2(A<=Ans)),A,3,dim(|LFACE->FACE

If one forgot their password, we have to reset it. So they input a username, we find it in the list, and then let them overwrite the password:

Code:
Input "USERNAME:",N
Input "PASSWORD:",H
H->|LFACE(2+dim(|LFACE)-2sum(cumSum(N=seq(|LFACE(A),A,1,dim(|LFACE),2
Note: The last few routines assume that the user exists.

Alright so apparently we're all gonna jump in on this project Laughing

It would be much easier to use complex numbers... Real part is username, imaginary part is password

Code:
Lbl A
ClrHome
Menu("FACEBOOK","SIGN UP",SU,"LOGIN",LI,"QUIT",Q
Lbl SU
Disp "CREATE USERNAME"
1
While Ans
Input "USERNAME: ",N
max(N=real(⌊FACE
If Ans
Disp "USERNAME TAKEN"
End
Input "PASSWORD: ",W
N+Wi→⌊FACE(1+dim(⌊FACE
Pause "ACCOUNT CREATED"
Goto A
Lbl LI
Archive ⌊FACE
Input "USERNAME: ",N
Input "PASSWORD: ",H
UnArchive ⌊FACE
N=real(⌊FACE
If max(Ans)
Then
If H≠imag(sum(Ans⌊FACE
Then
Pause "INCORRECT PASSWORD"
Else
Pause "LOGGED IN
End
Else
Pause "INCORRECT USERNAME
End
Lbl Q
ClrHome
Output(5,10,"FACEBOOK"
Wait 1
ClrHome


To find a user's location in a list with name N:

Code:
max((N=real(⌊FACE))cumSum(not(0real(⌊FACE

I also rewrote the rand→P part, because I didn't like having a very small but not null chance of the program randomly accepting an incorrect password. Besides, you can set the seed for the rand, which makes it trivial to bypass the whole thing by setting the seed before starting the program, saving the result to a variable, resetting the seed and recalling the value of the variable when its time to enter a password. Although, given that the level of security is approximately 0, if you know enough about TI calculators to do that, you probably know enough to break in without a password anyway.
It may be interesting to squish a string into an int so that usernames and passwords could contain letters, but some quick math shows that in order for the resulting int to fit in 14 digits, the string would actually have to be quite small (9 chars for letter-only and 8 chars for letters and digits and 7 chars for uppercase, lowercase and digits).
mr womp womp wrote:
Alright so apparently we're all gonna jump in on this project Very Happy
Yep! Totally. Sorry, old habits die hard.
mr womp womp wrote:
It would be much easier to use complex numbers
Somehow I completely forgot those existed.

Users should only be able to create a new user on their first use of the program:

Code:
If not(dim(|LFACE
Goto [CreateUser]


mr womp womp wrote:

Code:
Disp "CREATE USERNAME"
1
While Ans
Input "USERNAME: ",N
max(N=real(⌊FACE
If Ans
Disp "USERNAME TAKEN"
End
Input "PASSWORD: ",W
N+Wi→⌊FACE(1+dim(⌊FACE
Pause "ACCOUNT CREATED"
Did you forget that Repeat loops exist? Also, zero-dimension list warning.
Code:
Disp "CREATE USERNAME
Repeat not(Ans
Input "USERNAME: ",N
0
If dim(|LFACE
max(N=real(|LFACE
If Ans
Disp "USERNAME TAKEN
End
Input "PASSWORD: ",W
N+W[i]->|LFACE(1+dim(|LFACE
Pause "ACCOUNT CREATED


mr womp womp wrote:

Code:
Archive ⌊FACE
Input "USERNAME: ",N
Input "PASSWORD: ",H
UnArchive ⌊FACE
N=real(⌊FACE
If max(Ans)
Then
If H≠imag(sum(Ans⌊FACE
Then
Pause "INCORRECT PASSWORD"
Else
Pause "LOGGED IN
End
Else
Pause "INCORRECT USERNAME
End
How many services have you used say "Incorrect username"?
Code:
Repeat Ans
Archive |LFACE
Input "USERNAME: ",N
Input "PASSWORD: ",H
UnArchive |LFACE
max(N+H[i]=|LFACE
If not(Ans
Disp "INCORRECT USER OR PASS
End
Pause "LOGGED IN


mr womp womp wrote:
To find a user's location in a list with name N:

Code:
max((N=real(|LFACE))cumSum(not(0real(|LFACE

Code:
N=real(|LFACE
max(AnscumSum(not(0Ans


Deleting the N'th user:

Code:
|LFACE
seq(Ans(A-(A<=N)),A,2,dim(Ans->FACE


Resetting password:

Code:
Input "USERNAME: ",N
Input "PASSWORD: ",H
N=real(|LFACE
N+H[i]->|LFACE(max(AnscumSum(not(0Ans


Edit: Oh, hey, it doesn't like 0-length lists.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement