-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fun with js #3 #2
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok rozwiązanie.
4f7ae6569b55cb6275423ca1cdf31475e607da1d5204c110a58fb480c96e6eca | ||
*/ | ||
console.log(encodeText(data)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pewnie masz inny system niż ja, a Git zmienia wtedy znaki nowej linii :)
|
||
function encodeText(text){ | ||
return crypto.createHmac('sha256', text).digest('hex'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jest ok. Tylko nazwa funkcji encode...
może być myląca.
Takie pytanie: | ||
Czemu w przypadku innych algorytmów pojawiał się błąd? | ||
Myślałem, że pojawi się jakiś tekst. Natomiast ponieważ odszyfrowany jest złym algorytmem, to zwróci tekst bez sensu. | ||
Chodzi o jakieś sumy kontrolne dla różnych algorytmów? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Różne algorytmy mają różne "wymagania", np. czegoś w stylu sum kontrolnych, czy długości bloków.
let decrypted = decipher.update(encodedText, 'hex', 'utf8'); | ||
decrypted += decipher.final('utf8'); | ||
return decrypted; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Czy udało się rozkodować :) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tak, dziękuję za odpowiedzi :)
No description provided.