It's UWAweek 47

help3007

This forum is provided to promote discussion amongst students enrolled in CITS3007 Secure Coding. If posting a question, it's suggested you check first whether your question is answered in the unit Frequently Asked Questions (FAQ) list, and use the search box (on the right) to see if an answer to your question has already been posted.

Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

Note that any posts must comply with the UWA Code of Conduct and the UWA Academic Conduct Policy. That means you should (a) treat everyone with respect and courtesy, and (b) not post your solutions to an assessment that's in progress.

If asking a programming question, it's recommended you read How do I ask a good question? If reporting or troubleshooting a bug in software used in the unit, it's recommend you read How to report bugs effectively.
Displaying the 3 articles in this topic
Showing 3 of 170 articles.
Currently 34 other people reading this forum.


 UWA week 21 (1st semester, week 12) ↓
SVG not supported

Login to reply

👍?
helpful
7:03pm Tue 21st May, ANONYMOUS

Based on the project spec and the most recent lecture, the vigenere function can accept a key that contains both numbers and letters. What is the expected logic to process such a key, and could you please explain how this would allowed with the pre condition: \pre `key` must not be an empty string, and all characters in `key` must be within the range from `range_low` to `range_high` (inclusive). To me this seems contradictory, if the range passed in is A-Z. My thinking for possible logic is that if a character or number is encountered in the string that is not within the range, then do not apply a shift using that character/number, instead iterate through the key string to find the next occurance of a suitable character.


SVG not supported

Login to reply

👍?
helpful
7:06pm Tue 21st May, ANONYMOUS

An addition to this question is how the similar pre condition for Caesar works: if a key outside the range of -26 and 26 is passed, do we modulo to bring it back into range, or check this condition before calling the function and return? To me it seems the pre condition lends itself to the second option, of checking the key is inside the range before calling caesar_encrypt or decrypt.


SVG not supported

Login to reply

👍?
helpful
3:08pm Wed 22nd May, Arran S.

This student contacted me off-forum, so I won't make a full reply here, but briefly:

  • Anything from the lectures is non-normative - it's the project spec you should be working off
  • What sort of key the Vigenere functions are required to accept depends entirely on the values of low_range and high_range. If a caller ever supplies a key containing a character outside those ranges - they've violated the function's preconditions, and the function can do anything it likes.
  • The purpose of a test is to invoke some function or component, and to ask: when invoked, is the function's behaviour in accordance with its specification? It never makes sense to write a test that violates the preconditions, so we (the markers) promise never to do so.
  • That said: we will try to call your functions in the most unexpected and unpleasant ways we can, while remaining within the letter of the preconditions.

cheers,

Arran

ANONYMOUS wrote:

Based on the project spec and the most recent lecture, the vigenere function can accept a key that contains both numbers and letters. What is the expected logic to process such a key, and could you please explain how this would allowed with the pre condition: \pre key must not be an empty string, and all characters in key must be within the range from range_low to range_high (inclusive).

To me this seems contradictory, if the range passed in is A-Z. My thinking for possible logic is that if a character or number is encountered in the string that is not within the range, then do not apply a shift using that character/number, instead iterate through the key string to find the next occurance of a suitable character.

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy