Questions tagged [pset2-crack]
The pset2-crack tag has no usage guidance.
43
questions
0
votes
0
answers
8
views
cs50 pset2 crack
i have completed all the previous pset before crack without much trouble. i am not clear on how to link argv[1] with password and not clear either on what loop to use. neested loop or normal loops of ...
0
votes
1
answer
98
views
Problem with Pset2!
I'm really not sure why my code doesn't work for char's that are L, and when 20 is added to them on line 34. Appreciate the help for a beginning coder please:)
int main(int argc, string argv[])
{
//...
0
votes
1
answer
33
views
crack, Different passwords produce the same HASH
i have a hard time understanding the crypt function and since there aren't any technical details of how it works out there, i tested it and i observed that it is producing the same hash for different ...
0
votes
1
answer
61
views
PSet2 Crack: crypt() returning same hash
EDIT: I solved my problem by entirely re-writing my code. I still am not sure what went wrong.
I've been trying to go at the crack problem for a while now and it keeps returning the same hash. For ...
0
votes
1
answer
40
views
PSET 2, Issue with crypt function output
Trying to finish the crack assignment and I'm getting different outputs using the crypt function with what I believe is the same input. Using a different set of code (that just returns the output of ...
0
votes
1
answer
145
views
PSET 2 Crack: Getting salt from argv[1]
I think I might be misunderstanding some basic things about strings because I'm really struggling to get the salt in crack. I'm getting compile errors from the below code. I've also tried making the ...
0
votes
1
answer
112
views
How to generate passwords in Crack Pset 2?
Another question about Crack in pset2. Can I have passwords that are mixed with both lowercase and uppercase letters? Like: “PIzzA”?
If so, I’m a little confused on how to write the code to get all ...
0
votes
1
answer
80
views
Question about Crack in PSET2
My questions about Crack are:
Before we pass in salt do we have to define it ourselves? For example, since it's a 2 digit number do we create a method that produces random numbers for salt or does it ...
0
votes
1
answer
103
views
crack.c: No response 😒
When I run my crack.c, the program never responds. It just sits there and wastes time. I even tried debugging it on the CS50 IDE, and it was normal. Here is my code:
#include <cs50.h>
#include &...
0
votes
1
answer
2k
views
crack.c: UndefinedBehaviorSanitizer:DEADLYSIGNAL --SOLVED--
When I run my code:
#include <cs50.h>
#include <stdio.h>
#include <crypt.h>
#include <string.h>
string crack(string hashed);
string deleteAll(string s, char target);
// ...
0
votes
2
answers
194
views
pset2 crack: Takes too long
My code takes like 1-2 minutes to execute, and the result is always Killed. Here is my code:
#include <cs50.h>
#include <stdio.h>
#include <crypt.h>
#include <string.h>
...
1
vote
1
answer
156
views
Pset2 can't crack stelios password
My solution for Pset2 crack works for every password except for stelios's. I can crack other 5 character passwords (e.g., ABCDE, etc.), but for some reason, my code runs for 60m9.563s when trying to ...
0
votes
1
answer
64
views
Crack program compiles but appears stuck when executed
So I've looked up a few posts with similar issues and taking the advice of commenters I've put printf after every For loop to see where the program gets stuck.
It was initially was printing one ...
0
votes
1
answer
54
views
pset2 - crack - array declaration not working
I feel stupid, why is not printing "ROFL" in this program? I am testing for the crack.c program:
#include <stdio.h>
#include <cs50.h>
//int main (int argc, string argv[])
int main (int ...
1
vote
1
answer
3k
views
pset2: Crack takes a lot of time
I take an average of 20 minutes to crack the password and some people are saying it can be done in less than 30 seconds, I have been trying to find out why my code takes that much time but I can't.
#...
0
votes
1
answer
110
views
PSET 2 - CRACK - Does not give output/program loops seemingly forever
I managed to get the program to output some of the passwords but not all. For some of the hashes I use as input, the program executes seemingly forever. (haven't let it go on longer than 4 mins)
Any ...
0
votes
1
answer
69
views
CS50: Crack - 'incompatible pointer types' error
I'm getting an 'incompatible pointer types' error when I try to compile my code. Wondering if anyone can help me figure out why?
Here's my code and the error:
0
votes
1
answer
96
views
pset2 crack.c Random Characters Follow When Getting Salt
I've been scratching my head at this for the better part of a day now:
When I try to save the salt in a separate string called salt using the first and second characters of the second element of argv[...
0
votes
1
answer
185
views
Pset2 Crack: why are CS50's crypt hashes different from mine?
When I tested the crypt function, it returned different hashes than the ones listed in CS50's pset2, given the same salt and key:
{
char* testhash = crypt("rob", "50");
printf("hash for rob: %s\n", ...
0
votes
1
answer
134
views
Crack missing two of ten hashes
My version of crack.c is not finding two passwords. As far as I can tell, I am exhausting the entire alphabetic search space, and I've found both upper and lowercase passwords. Assuming there's no ...
0
votes
1
answer
249
views
Pset2 Crack - Including printf causes passwords I am generating to change
I'm trying to incrementally solve the crack problem by doing the following:
Crack one character password "a" with salt of "50" (hash: 50OqznXGVcOJU)
Crack two character password "aa" with salt of "50"...
0
votes
1
answer
36
views
Comparing the hashed version of different string to the provided hash.
I am badly struck at the Crack problem in pset2.
I have an idea which uses 5 for loops, to check for all the possible variations of the alphabets. Considering a case where the password is only of ...
-1
votes
1
answer
155
views
Why this code cannot decrypt passwords which are more than two characters?
#include <cs50.h>
#include <crypt.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#define _XOPEN_SOURCE
int main(int argc, string argv[])
{
if (argc != ...
0
votes
1
answer
120
views
Pset 2 Crack producing different hashes for same variables each time
My program produces a different hash code for each variable, and I don't know why.
char check[] = {"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"};
char pw[5];
string checked_hash;
...
0
votes
1
answer
424
views
command line arguments help to use them in the program
I'm not sure how to include the input from the command-line arguement.
I try to set the arguments equal to variables, bu it's not working.
#include <stdio.h>
#include <cs50.h>
int main(...
0
votes
1
answer
271
views
pset2 - crack.c all passwords working except one
So after struggling with crack.c for some time I thought I finally found a method that worked. To my dismay however, it cracks every password (as listed on [the problem specification][1]) except for ...
0
votes
1
answer
33
views
Pset2 crack variable changing value for no apparent reason
I'm working on crack and have been messing around with strcmp(), but something isn't working as expected. When I print s (with argv[1] != "hello") it returns the right value, but somehow between the ...
1
vote
1
answer
413
views
pset2 crack - stelios only password I can't crack
My crack code seems to be able to crack every single one of the hashes from pset2 except for stelios', which has hash 50nq4RV/NVU0I
Does this pw have anything particular not included in the other ...
1
vote
1
answer
339
views
PSET2 (Crack) - Comparing 2 hashes with strcmp() always returns 0
So, this isn't the full solution to the problem, I'm currently just messing around with crypt, I've got the following code:
#define _XOPEN_SOURCE
#include <unistd.h>
#include <stdio.h>
#...
0
votes
1
answer
176
views
pset2 crack.c, competence question
Thank in advance for any reply,
Im currently on crack.c in pset2, I have so far completed all other problems leading to this one. It seems like this problem is a few notches more advance then the ...
1
vote
3
answers
2k
views
PSet 2: Crack - Faster Methods?
I've just finished crack of problem set 2. My solution, though, seems quite ugly to me, as it was just some mindless brute force (in which I frankly struggled with strings for a while).
E.g. to ...
0
votes
1
answer
230
views
pset2 crack - values are equal but the program claims equality is false
As you can tell by the code (pasted below), my program is supposed to get the hash as a command line argument, and then prompt the user for a "guess" as to what the plaintext password might be. It ...
3
votes
1
answer
381
views
pset2 Crack - Looping through fgets
I'm trying to loop through a text file (seven lines in the file, with aaaa, aaab, aaac, etc listed) with password guesses for pset2 Crack. I am able to open the file, and iterate through the lines. ...
0
votes
1
answer
150
views
My crack.c code will compile, but fails to crack password (Brute force method) and takes approx. 4 minutes
I thought this code would iterate over all possible combos from aaaa-ZZZZ; however, it fails to do so. I would just like some insight into why my program may not be functioning properly. Thanks in ...
0
votes
0
answers
379
views
Crack.c in PSet2 - is strcmp() necessary? & other questions
So I've been stuck on crack.c for two weeks now (not literally - I have a full time job too ha) and on top of having 50 questions about it, I just can't get my head round the solution!
Basically I ...
0
votes
1
answer
4k
views
strcmp not evaluating as expected
I'm having trouble with a key section of my code where, for some reason that is beyond my skill level at this point, it is not comparing properly. For some reason it's evaluating to true for the wrong ...
0
votes
1
answer
211
views
why do I get segmentation fault for crack problem,
It seems I get segmentation fault when I try to decrypt the passwords, I somehow thought my logic is right but it seems it's not working. I also get four warnings in using crypt function for implicit ...
0
votes
1
answer
127
views
crack.c something weird is happening to the generated keys
This is how I am generating all of the keys and checking them (for debugging purposes I'm printing them out too)
char salt[] = "50";
char key[4] = { 0 };
char alphabet[] = "...
0
votes
1
answer
1k
views
crack.c pset2, second parameter of 'main' (argument array) must be of type 'char **'
I'm trying to initialize main like this
int main(int argc, char argv[])
so I can pass "argv" and the crypt() result to strcmp() like this
if (strcmp(argv, crypt(password, salt)) == 0)
{
...
1
vote
1
answer
440
views
I solved crack, but have a shallow understanding of the techniques used
On my quest to solve Crack, came up with a couple questions:
How do I know when to use strcmp(s1, s2)? How do I know when I'm comparing memory addresses and when I'm comparing the actual contents of ...
1
vote
1
answer
956
views
Pset2 - Crack: How to iterate through all combinations of alphabet
Probably a silly question, but please bear with me as I'm pretty new to this.
I'm stuck with Crack in Pset2. Can't wrap my head around how to go about iterating through all combinations of alphabet.
...
1
vote
2
answers
140
views
Crack: Segfault on CS50 appliance/ IDE/ CS50.io but fine on my computer
I'm trying to make PSET2 crack, however in online IDE I got segmentation fault.
I tried same thing on my local computer and it works fine.
What's wrong? Pls ignore the fact that code is ugly etc. ...
0
votes
1
answer
242
views
Pset2: Crack brute force, encryption part does not work
So I am trying to solve the password crack. I managed to create all possible 4 letter words with character from A to z. However the encryption using crypt does not always seem to work. I encrypted ...