
#include <stdio.h>
#include <unistd.h>
#include <string.h>

char *crypt(const char *key, const char *salt);
  
char secret[] = "AA7xkZcWfNGXg";    

int main(void) {
  char pass[9];
  char *hash, *nl;
  printf("What is the secret password?  ");
  fgets(pass, 9, stdin);
  if (nl = strchr(pass, '\n')) {
    *nl = '\0';
  }
  if (strcmp(crypt(pass, secret), secret)) {
    puts("Sorry.");
    return 1;
  } else {
    puts("Access granted.");
    return 0;
  }
}
