Skip to content

Hints on cryptography about "random" modules#967

Merged
cmccandless merged 2 commits into
exercism:masterfrom
lucasloisp:HINTS-cryptography
Oct 24, 2017
Merged

Hints on cryptography about "random" modules#967
cmccandless merged 2 commits into
exercism:masterfrom
lucasloisp:HINTS-cryptography

Conversation

@lucasloisp
Copy link
Copy Markdown
Contributor

Closes #774 by creating a HINTS.md file for every exercise involving cryptography or the use of random module.

The wording is as follows

Hints

Should I use random or secrets?

Python, as of version 3.6, includes two different random modules.

The module called random is pseudo-random, meaning it does not generate
true randomness, but follows an algorithm that simulates randomness.
Since random numbers are generated through a known algorithm, they are not truly random.

The random module is not correctly suited for cryptography and should not be used,
precisely because it is pseudo-random.

For this reason, in version 3.6, Python introduced the secrets module, which generates
cryptographically strong random numbers that provide the greater security required for cryptography.

Since this is only an exercise, random is fine to use, but note that it would be
very insecure if actually used for cryptography.

@lucasloisp lucasloisp changed the title Hints cryptography Hints on cryptography about "random" modules Oct 21, 2017
@N-Parsons
Copy link
Copy Markdown
Contributor

@lucasloisp, I believe that the hints file should be located at .meta/hints.md in order for the configlet to find it and incorporate it into the README - you can find details for this in the configlet's README.

Some of these exercises don't seem to require randomness, specifically:

  • atbash-cipher
  • crypto-square
  • rail-fence-cipher
  • rotational-cipher

I also wouldn't consider robot-name to be a cryptographic exercise - there are times where random is the most suitable module.

@lucasloisp
Copy link
Copy Markdown
Contributor Author

Noted! I've made the necessary updates

Copy link
Copy Markdown
Contributor

@ilya-khadykin ilya-khadykin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR

Please read my comment

Comment thread exercises/diffie-hellman/.meta/HINTS.md Outdated
@@ -0,0 +1,18 @@
# Hints
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please rename the file to hints.md (lowercase) for consistency

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! I'd done it but apparently there was some error in renaming

Copy link
Copy Markdown
Contributor

@ilya-khadykin ilya-khadykin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@N-Parsons could you take a look?

Comment thread exercises/diffie-hellman/.meta/hints.md Outdated
@@ -0,0 +1,18 @@
# Hints
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heading level 1 here is going to be a the wrong level for the README - the first level in this document should be level 2 (##). Personally, I would just delete this heading and keep the one below - two headings for one thing would seem strange in the flow of the README.

The calculations produce the same result! Alice and Bob now share
secret s.

## Notes
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This README (and the one for simple-cipher) will need either regenerating to include the hint. Alternatively, you can just copy-and-paste it in at this location.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lucasloisp, the section needs to go before ### Submitting Exercises, since that's where it goes if we regenerate the file.

Comment thread exercises/simple-cipher/.meta/hints.md Outdated
@@ -0,0 +1,18 @@
# Hints
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, I think like line should just be removed.

@N-Parsons N-Parsons self-assigned this Oct 24, 2017
Adds HINTS file to "crypto-square"


Adds HINTS file to "rail-fence-cipher"


Adds HINTS file to "simple-cipher"


Adds HINTS file to "rotational-cipher"


Adds HINTS file to "robot-name"


Takes recommendations into account
@cmccandless cmccandless merged commit b3ba31d into exercism:master Oct 24, 2017
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.

4 participants