Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

maciek-wozniak
Copy link

No description provided.

Copy link
Contributor

@Ami777 Ami777 left a 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));
Copy link
Contributor

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');
Copy link
Contributor

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?
Copy link
Contributor

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;
}
Copy link
Contributor

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ć :) ?

Copy link
Author

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants