Skip to main content

Questions tagged [crypt]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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 ...
Foudouki's user avatar
0 votes
1 answer
63 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 ...
PotatoesFall's user avatar
0 votes
1 answer
43 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 ...
soccermom9424's user avatar
0 votes
1 answer
164 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 ...
Evan Carroll's user avatar
0 votes
1 answer
1k 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 [-...
Evan Carroll's user avatar
0 votes
1 answer
30 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 <...
Nikita Kokorin's user avatar
0 votes
1 answer
176 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 ...
Jacob Pieczynski's user avatar
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", ...
gobears's user avatar
-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 != ...
kukuku's user avatar
  • 1
0 votes
1 answer
339 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 ...
Srajan Tiwari's user avatar
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 &...
Giovanni Piacenza's 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 ...
Kem's user avatar
  • 1
2 votes
1 answer
2k views

Crack - launching and crypt function

I'm on the crack challenge from pset2 and I don't understand how to compile the program. When I use clang -ggdb3 -O0 -std=c11 -Wall -Werror -Wshadow crack.c -lcrypt -lcs50 -lm -o crack as ...
Vasilii Vakhtin's user avatar
1 vote
1 answer
1k views

pwd_context.encrypt Depreciation Warning Pset7

I've noticed an error that pops up whenever I try to register a new user in cs50 finance. I've first noticed this today - I've never this problem before, and I've used the registration many times. ...
Jason_V's user avatar
  • 182
0 votes
2 answers
328 views

crypt key char concatenation (pset2/crack)

I have created a series of for loops to iterate through every combination of a 4 letter long password (i j k l). I wish to enter each iteration into the crypt function but what I have been trying has ...
Fjtje17395jfnf's user avatar
5 votes
1 answer
1k views

PSET2: CRACK vs POINTERS

SPOILERS (maybe) Hi, I have just started working on crack. I have no previous experience, at least not too much but I'm trying to grasp the logic behind this and it seems my biggest issue for this is ...
Karvin's user avatar
  • 53
0 votes
1 answer
1k views

Use of crypt function - comparing output

I've been scratching my head as to how to use the crypt function, even after having watched the walkthrough video a dozen times and trying to decipher the man crypt pages. I've written this code to ...
jumbojeta380's user avatar
1 vote
2 answers
604 views

Usage of Crypt Function?? Correct usage?

I am using the crypt function like this. Is it correct? string lol = crypt(plaintext, salt); Here plaintext and salt are both character arrays(strings). Am I using this function correctly? When I ...
Satanic Saint's user avatar
0 votes
1 answer
447 views

Crypt() includes and compiling

I am currently working on pset2 crack, and I have a question regarding the use of crypt(). This is the synopsis I have got from man: SYNOPSIS #define _XOPEN_SOURCE /* See feature_test_macros(7) ...
Steve Bunting's user avatar
0 votes
1 answer
104 views

Where can I link libraries to the debugger in ide.cs50.io?

I need to debug a program that uses the crypt library, so I have to use -lcrypt, but the debugger automatically uses Make. How can I tell it to use Clang with arguments?
Aizen's user avatar
  • 309
1 vote
2 answers
186 views

Why is d = 185 to satisfy de = 1 mod m (where m = 924)? (Wk2, shorts: cryptography)

At the 6:50 min mark of this video: https://courses.edx.org/courses/HarvardX/CS50x3/2015/courseware/c0986764d695405f9d995f43b7c10676/5194906ad75c4edb9ecd401df372b8f3/ here's a screen shot, too: https:...
TryingToLearn's user avatar
0 votes
1 answer
242 views

The crypt function won't work, despite me linking the crypt library

#define _XOPEN_SOURCE //DES cypher #include <crypt.h> // #include <cs50.h> //GetString, booleans, and string datatype #include <stdio.h> //printf #include <...
Jon's user avatar
  • 21
2 votes
1 answer
1k views

What's the purpose of the 'salt' string? Isn't it contained in the hashed string anyway?

When checking the manual entry for man crypt, I read: The returned value points to the encrypted password, a series of 13 printable ASCII characters (the first two characters represent the salt ...
abelinux's user avatar
  • 1,170
1 vote
1 answer
420 views

Using crypt function for comparing password hashes

I encountered a problem while implementing my extra feature "Change Password". In the "changepassword_form", it asks for the old password and compares it with the 'hash' in the 'users' table to check ...
Sid Ramesh's user avatar