Questions tagged [crack]
The crack tag has no usage guidance.
94 questions
0
votes
1
answer
35
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 ...
1
vote
0
answers
64
views
CS50, pset2, crack, suggested dictionary file
I am taking cs50 on edx and I am currently on pset2, crack. I want to find a dictionary file that has a fair (maybe over 50,000?) amount of words in it to encrypt and compare them with the hashed ...
1
vote
0
answers
100
views
PSET 2 - Crack - A way to improve?
To give a bit of context I am taking CS50 through EdX in 2019.
I worked on pset2 (crack) the last few days. I got it "right" though I wonder if there are some ways to improve (1) the efficiency and (...
0
votes
2
answers
58
views
Week 2 CRACK: Erratic behavior with NULL '\0' when printing combinations of letters
I want to iterate through all possible combinations of the alphabet, including single letter outputs. For this purpose I included the use of '\0' so the first print out in the iteration is the sigle ...
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
0
answers
177
views
Crack(python) very slow
from sys import argv
from crypt import crypt
from string import ascii_letters
from itertools import product
if len(argv) != 2:
print("Incorrect number of arguments")
exit()
hashed_p = argv[1]...
0
votes
2
answers
50
views
Crack.c Error in 2 passwords
For pset2 crack, I have managed to crack 10 of the 12 passwords given, but, the other 2 passwords are not getting cracked. Any help would be appreciated.
Code:
//Cracks password encrypted using ...
0
votes
1
answer
115
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
81
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);
// ...
1
vote
1
answer
501
views
PSET6 CRACK (python)
I'm stuck on Crack (in Python). I wrote the following code, which I think should cover every case, however it runs for hours without finding a solution. Any thoughts/advice are appreciated.
from sys ...
1
vote
1
answer
172
views
Pset2 Crack - works for one password 50i2t3sOSAZtk--->(lol), but not for other passwords - why?
this version of crack works for lol, and prints the following:
new hash = 50i2t3sOSAZtktr [what is the 'tr' at the end???]
lol
for other passwords, the program never returns a decoded pw, just ...
0
votes
1
answer
36
views
Unable to get crypt to print correct hash
i can get crypt to print the expected hash when i put the string directly into the function. however when passing a char array in i seem to be getting a different hash. Any suggestions?
char ...
0
votes
1
answer
65
views
Bug? My Crack code was accepted though it doesn't work properly
Can't totally get a thing. My code was accepted and the score is 5 out of 5, however it does't work properly. After searching through the forum I inderstood that I should use strcmp() for comparing ...
0
votes
1
answer
254
views
pset2/Crack - Terminal disconnected after some time of running
My Crack program is OK, I found all passwords with 4 digits or less, but when it comes to 5 digits, after 10-20 min running my terminal gets a red message "Terminal Disconnected", and I have to start ...
1
vote
1
answer
42
views
How long are the passwords for crack?
The docs seem to have conflicting instructions,
Assume that each password is no longer than (gasp) four characters
And then,
Note: The walkthrough video incorrectly states that passwords are no ...
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
31
views
Unexpected variable change
Variable hash1 becames equal hash2 after operator hash2 = crypt(key,"50");.
#define _XOPEN_SOURCE
#include <unistd.h>
#define alphalen 52
#define halfalphalen 26
#define plen 5
#include <...
0
votes
1
answer
67
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 ...
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
2
answers
64
views
two strings (appear equivalent) return different hash
I have left some debug statements in my code so it should be easy to understand my problem. (these statements have comment DEBUG)
I have manually ran crypt with salt 50 and password A.
I have ...
1
vote
2
answers
106
views
cs50 week 2 crack compiles but doesn't do anything
Any advice on why the code isn't running? Yet it compiles?
Code Link: https://pastebin.com/XMhgJ49k
Thanks!
0
votes
2
answers
490
views
"Program received signal SIGSEGV, Segmentation fault" on using recursion with crack pset 2
I am trying to get 3 characters combinations using recursion but after some calls i get Segmentation fault
#include <cs50.h>
#include <stdio.h>
void three_Characters(char c, char c2, ...
0
votes
1
answer
177
views
PSet2 - Why does crack only work with four characters or less?
I have been working on crack lately, and I have been running into a lot of problems. Sorry, but lately I have been needing to be on here a lot, probably asking stupid questions. I want to thank you ...
0
votes
1
answer
34
views
PSet2 - Decrypted Password the Same Every Time
On Pset2, I feel like I am so close to finally finishing this project up. I am working on the crack one and no matter what password I input, the same password, ZZZZ returns. Where could I possibly be ...
0
votes
1
answer
63
views
PSet 2 Crack - Password not changing
I am on the crack challenge in PSet 2. When I am reassigning the variables to check the crypt, I keep getting a segmentation error, so it's not changing. I understand my code is messy, but here it is. ...
0
votes
1
answer
111
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
75
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
2
answers
727
views
Style50 says "Looks good!" but "style" grade only 4 out of 5?
For pset2 - crack, I've run style50 and got a "Looks good!" but upon submitting, my style grade is marked as 4 out of 5. I see this question has been asked in the past and the solution usually was "...
1
vote
1
answer
249
views
SPEED: python vs C crack program
I have implemented a python and c version of crack way back from problem set 2. Both of them work, and both use the same algorithms/processing just expressed in two different languages. Out of ...
0
votes
1
answer
47
views
PSET2 Crack.c Segmentation Fault issue
Here is a clipping of my code, I know that the segmentation fault happens in the else condition
char* testCase = "AAAAA\0";
string salt = "50";
for (int i = 0; i <= 5; i++)
{
//Create random ...
0
votes
0
answers
276
views
Crack - recursive (Python)
For the brute force password cracking method I have used this iterative approach.
I tried to write a recursive function that did the same, but I am struggling.
Could anyone give some pointers on ...
0
votes
1
answer
109
views
How to better condense individual for loops per amount of characters on crack.c
currently I have a working solution for crack.c. However, it relies on me the programmer copying the previous for loops for the previous amount of characters before it and adding another for loop ...
0
votes
1
answer
38
views
just a quick question about the ends of char lists for PSET2 crack.c
I am having trouble with all the different types: strings, char, char * while appending, adding, concatenating variables that end up not compatible since they are different types.
I am trying to run ...
0
votes
1
answer
221
views
pset2 crack.c not working on 5 digits codes but working on all others
i'm brand new here also bit dyslexic my spelling can be rough in comments so bee gentle pls:)
basically I've made a code for crack.c which cracks 1-4digit passwords but does not work with 5 digit ...
1
vote
1
answer
267
views
Pset2 Crack problem
I wrote a code for the crack problem. To test the code I set hpass
(stands for hashed password which is the input the user is going to enter) to crypt("AB","50")(see line 15). The expected output of ...
0
votes
1
answer
589
views
Pset2: Crack - Why am I getting an error: Expected expression?
When I attempt to "make" this code, I'm getting error: expected expression on lines
crack.c:33:31:
and
crack.c:37:31:
Tried to debug this for ages but I'm just out of my depth, am I missing ...
0
votes
1
answer
102
views
Submission not being graded Sentimental/Crack
it has been quite a few days but my submission for sentimental crack hasn't been graded. Moreover, pset 8 shows no submissions even after submitting my work!
Whom do I reach out to?
Kindly help me.
2
votes
1
answer
303
views
pset2 crack password does't work
I'm trying to make pset2 crack but having so much problems and my head is about to explode.
Here is my code; my first error is on line 41. I never get to pass a value to the key for crypt. I'm very ...
-1
votes
1
answer
156
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 != ...
3
votes
1
answer
853
views
PSET 2 - Can Crack be implemented for 5 characters in a more efficient way?
Okay, so I've finished the crack problem, and it runs, but since the pset2 now tells us the passwords can be upto 5 characters long, it takes about 48 minutes to get the password match for "zzzzz".
...
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
428
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(...
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
800
views
End program by returning exit code 0 from bool function
so, for pset2 crack task i've generate a password, then encrypt this password and a salt to some result by
result = crypt(pass, salt);
After i want to compare result with hash, so i implemented a ...
0
votes
1
answer
70
views
Extra charters added to char array
I keep getting an extra characters added to the end of my char arrays. When I execute the code below, I get "Hash: 50jMstBtCmj7s roflC}B. Where did the extra C}B at the end of the key array come ...
0
votes
1
answer
499
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 &...
0
votes
1
answer
193
views
segmentation fault on crack
I've been trying crack problem in pset2 and most of the times it doesn't print something or gives segmentation fault
I've tried to debug it using debug50 but that takes a great deal of time and even ...
0
votes
2
answers
536
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 ...