Questions tagged [crypt]
The crypt tag has no usage guidance.
24
questions
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
60
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
132
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 ...
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 [-...
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 <...
0
votes
1
answer
175
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
184
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", ...
-1
votes
1
answer
154
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
338
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 ...
0
votes
1
answer
498
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
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 ...
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 ...
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. ...
0
votes
2
answers
319
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 ...
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 ...
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 ...
1
vote
2
answers
602
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 ...
0
votes
1
answer
444
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) ...
0
votes
1
answer
97
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?
1
vote
2
answers
183
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: http:/...
0
votes
1
answer
227
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 <...
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 ...
1
vote
1
answer
418
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 ...