Post by 🪐 Lena Sędkiewicz
Coding and hacking || Intern Software Engineer at Bayer
Nadrabiam opis z wczoraj #dzien12 oraz dziś #dzien13 #cyberwakacjeznthw CodeSignal działa, więc nadrabiam kurs o błędach kryptograficznych. I tu poznałam już dwie grupy sporych błędów: 💜 sekrety zapisane w kodzie (hasła, tokeny, klucze API i inne dane dostępowe) 💜 złe hashowanie haseł (np. za pomocą łatwych do złamania algorytmów, brak soli) Jak to naprawić? 💜 tworzymy plik .env i DODAJEMY do .gitignore (bez tego ostatniego będzie potrzebna rotacja kluczy...) 💜 wszelkie sekrety trzymamy w .env w formie zmiennych środowiskowych, które można wykorzystać w kodzie z pomocą np. biblioteki dotenv 💜 jako fallback do zmiennych w kodzie dajemy pusty string 💜 w hashowaniu haseł korzystamy z dobrych algorytmów (np. Argon2), dodajemy sól 😎 Not The Hidden Wiki, Albert Miechowicz - wciąż jestem w grze 🤣 --- Catching up on descriptions from yesterday #day12 and today #day13 #cybersummerwithnthw CodeSignal is working (yay!), so I'm catching up on the course about cryptographic failures. And here I've already learned about two groups of significant errors: 💜 secrets saved in the code (passwords, tokens, API keys, and other access data) 💜 bad password hashing (e.g., using easy-to-break algorithms, no salt) How to fix it? 💜 create an .env file and ADD it to .gitignore (without the latter, key rotation will be needed...) 💜 keep all secrets in .env as environment variables that can be used in code with the help of, for example, the dotenv library 💜 use an empty string as a fallback for variables in the code 💜 for password hashing, use good algorithms (e.g., Argon2), add salt 😎