Questions tagged [crack.c]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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 ...
user avatar
  • 115
0 votes
1 answer
78 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 ...
user avatar
  • 115
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 &...
user avatar
0 votes
1 answer
1k 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); // ...
user avatar
0 votes
2 answers
191 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> ...
user avatar
0 votes
1 answer
49 views

my crack.c actually works, but doesnt give away the key! Pset2

I am trying to figure out how to solve the crack problem from pset2, everything works fine with compiling but when I try to crack the hash from the example 50cI2vYkF0YU2 which is Zamayla's ...
user avatar
0 votes
1 answer
113 views

Basic use of crypt in crack.c? (Hash "ROLF")

Here is a quick test case for crack direct from the CS50 AP material, $ ./crack 50fkUxYHbnXGw ROFL Here is my code, #define _XOPEN_SOURCE #include <unistd.h> #include <stdio.h> int ...
user avatar
0 votes
1 answer
909 views

crack.c: error: implicit declaration of function 'crypt' is invalid in C99

When I try to compile with clang -ggdb3 -O0 -std=c11 -Wall -Werror -Wshadow crack.c -lcrypt -lcs50 -lm -o crack I get crack.c: error: implicit declaration of function 'crypt' is invalid in C99 [-...
user avatar
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. #...
user avatar
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 ...
user avatar
0 votes
1 answer
337 views

My crack code works for rofl but not for all

My crack code works for the rofl code but not for all I tried two other codes and I don't know why was it not able to crack thos codes even when I increased my range of characters for search #define ...
user avatar
2 votes
2 answers
238 views

PSET2, crack.c Did this problem fall out of the sky from week 115? Am I overthinking this?

This is the spec: Specification Design and implement a program, crack, that cracks passwords. Implement your program in a file called crack.c in a directory called crack. Your ...
user avatar
  • 25
0 votes
1 answer
491 views

CS50 2017 crack.c not working properly

Can't understand why my code is not working. Tried 2 different loops to arrive at the solution but the first one does not arrive at anything and keeps on going: #include <stdio.h> //#include &...
user avatar
0 votes
2 answers
535 views

PSET2: Can't figure out what's wrong with my crack.c code?

I've been trying to get my crack code working for days now. It took me a while to even understand the problem but I think I have somewhat of a handle on it now. My code compiles completely fine but ...
user avatar
  • 1
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 ...
user avatar
0 votes
0 answers
377 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 ...
user avatar
0 votes
1 answer
3k 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 ...
user avatar
  • 3
0 votes
1 answer
125 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[] = "...
user avatar
0 votes
1 answer
817 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) { ...
user avatar
0 votes
1 answer
247 views

cs50 pset2- crack.c gives me a segmentation fault

Here's the program: #define _XOPEN_SOURCE #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <cs50.h> int ...
user avatar
  • 103