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 78 tagged articles
Showing 78 of 170 articles.
Currently 38 other people reading this forum.


 UWA week 23 (1st semester, 1st exam week) ↓
SVG not supported 12:22pm Tue 4th Jun, Arran S.

Hi Joel, Unfortunately not - though I'd love to have project marks and feedback available before the exam, I'm constrained by the marking resources available to me. Cheers Arran


SVG not supported 8:20pm Mon 3rd Jun, Joel W.

Hi I've looked all through FAQ and can't see a definitive answer, just wondering if the project marks will be released before the exam? Thankyou


 UWA week 21 (1st semester, week 12) ↓
SVG not supported 1:24pm Fri 24th May, Arran S.

Hi, Sure, just email me - you're correct, the late submissions area isn't open by default. (If I make it open by default, Moodle starts warning all the people with on-time submissions that they have an assessment due.) Cheers Arran


SVG not supported 9:45pm Thu 23rd May, ANONYMOUS

Hi Arran, I have decided to submit again, but I've discovered that the late project submissions area of Moodle is not open for me to submit. I've seen in an earlier thread that you've fixed it for others, but maybe it is not working for me because I d...


SVG not supported 6:07pm Thu 23rd May, Arran S.

Hi, The cli function is expected to print output to stdout and stderr, so printing to those file-streams won't interfere with the marking scripts. The marking scripts capture your function's output by creating in-memory "files" using memfd create(...


SVG not supported 5:52pm Thu 23rd May, Arran S.

Hi Shashwat, That's not what the Moodle logs say. They say that you were still using the testbed area up until 4 58 01 PM. At 4 59 55 PM, you opened the project submission area for the first time ever. And at 5 00 pm, having failed to make a submissi...


SVG not supported 5:44pm Thu 23rd May, Shashwat A.

Thank you Just another question, since I submitted before the due time but Moddle didn't let me, will this still cause a late penalty.


SVG not supported 5:38pm Thu 23rd May, Arran S.

Hi Shashwat, The late submissions area should be open now. Cheers Arran


SVG not supported 5:36pm Thu 23rd May, ANONYMOUS

Somehow, I have only just remembered that there is a difference between stdout and stderr. My project code has been printing error messages to stdout. Would this interfere with the marking scripts, and is it worth putting in a late submission now tha...


SVG not supported 5:11pm Thu 23rd May, Joshua T.

Same, it pushed me out just before and didn't save as it was loading in. All submission windows have now closed including the late one.


SVG not supported 5:09pm Thu 23rd May, Shashwat A.

I was on time (around 4 50ish) but it kicked me out and yeh the late submission isn't open too


SVG not supported 5:05pm Thu 23rd May, Gemma L.

I'm having this issue too. I'm unable to submit despite being minutes past the due date. The late submission area has the date January 1 2024.


SVG not supported 5:02pm Thu 23rd May, Shashwat A.

I submitted my code on moddle however, it kicked me out and didnt save my code. Now it is not letting me submit anything or open the submission. Please help


SVG not supported 12:40pm Thu 23rd May, ANONYMOUS

Would you be willing to restate the answer, or link the previously given response? I've made an honest effort to look through the help forum, but there's only so many vaguely titled articles I can trawl through before losing my mind. Thanks


SVG not supported 12:16pm Thu 23rd May, Arran S.

It's nearly always a good idea to include newlines at the end of output to stdout or stderr. Besides the fact that it makes the output more legible, output to a file stream is buffered - see here https www.gnu.org software libc manual html node B...


SVG not supported 12:03pm Thu 23rd May, Arran S.

Yes, this has already been answered. ANONYMOUS wrote


SVG not supported 9:40pm Wed 22nd May, ANONYMOUS

Hi, Are we able to use newlines at the end of our stderr message? I am aware that we should for the stdout outputs but I would like to make sure for stderr, given the automated marking system. Thank you


SVG not supported 8:01pm Wed 22nd May, ANONYMOUS

Hoping to get some clarification as to how we should be handling cases where an out of range int is passed into the caesar functions. From crypto.h, we know that a precondition of key is that it must fall within the range of (range low - range hig...


SVG not supported 3:13pm Wed 22nd May, Arran S.

Answered off-forum. But in brief what we're writing in the project isn't really a program , but a library (admittedly a very small one) - a set of functions serving some common purpose. So as library maintainers, we can just declare caesar decry...


SVG not supported 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 (https developer.mozilla.org en-US docs Glossary Non-normative) - it's the project spec you should be working off - Wh...


SVG not supported 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 see...


SVG not supported 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 c...


SVG not supported 6:32pm Tue 21st May, ANONYMOUS

Reimplementing the logic seems unecessary and redundant, as suitable code already exists in another function. It potentially also improves the readability of the function. On the other hand, it prevents any potential separation of caesar decrypt from...


SVG not supported 3:41pm Tue 21st May, Arran S.

Hi Luke, That doesn't sound right. Where do you see that stipulation? Can you please give the relevant part of the project specification? Also, can you clarify, what do you mean by "the program"? The specification doesn't ask you to submit a "program"...


SVG not supported 2:56pm Tue 21st May, Luke G.

For this assignment the stipulation is that if the program is detected to fail we abort it and return 1, the standard practice of saying that a program encountered an error. A lot has been said about the assert function which I'm wondering if we are...


SVG not supported 2:53pm Tue 21st May, Arran S.

Hi Hugo. Well, where are you getting the requirement from that the Vigen re key shouldn't contain digits or characters outside the range? That might provide some clue as to how a violation needs to be handled. Cheers Arran


SVG not supported 2:27pm Tue 21st May, Hugo S.

Hi Arran, What should happen if the vigenere key contains digits or characters that are outside the range? Should a string like "abcd9" be rejected? What about "abcd "? Thanks in advance


SVG not supported 2:03pm Tue 21st May, Arran S.

Hi, No worries. To clarify just paste your implementations (including any documentation for cli ) into Moodle. As the header file itself says, it isn't to be submitted, so just include your documentation block for cli with the source. (It's common t...


SVG not supported 1:27pm Tue 21st May, Arran S.

Hi, Well, really it's up to you to apply your best understanding of appropriate software development principles, and decide this for yourself. But perhaps expand on your thinking here, a little bit - can you suggest reasons for or against calling cae...


SVG not supported 1:17pm Tue 21st May, Arran S.

Hi, They don't need to be explicitly called, no. (You can if you want, but tbh it makes the code rather awkward.) The intent is just for you to make use of the logic you came up with while implementing the Caesar functions my apologies, the spec...


SVG not supported 1:12pm Tue 21st May, Arran S.

Hi, I assume you mean "the submission area", not "the test area". It works by compiling your code using GCC, and then linking it against a "main.c" file which calls the implemented functions. If the code fails to compile or link, then that indicates th...


SVG not supported 1:05pm Tue 21st May, ANONYMOUS

Forgive my confusion, but I'm just curious as to how our code and header file (assuming that this needs to be submitted due to the documentation requirement of cli() ) need to be submitted via Moodle. Will there be two fields, one where we paste the C...


SVG not supported 1:04pm Tue 21st May, Arran S.

Hi all, I've enable a "testbed" area in Moodle as well. It's no substitute for running your own tests (with sanitizers enabled, and at varying optimization levels), and if you rely on it solely, you may well miss errors in your code. But it's there fo...


SVG not supported 10:22am Tue 21st May, ANONYMOUS

Hi, thanks for the response. I believe its probably a problem with my environment so I will test using Vagrant and see what happens. Thanks again


SVG not supported 9:42am Tue 21st May, ANONYMOUS

Hi, Are we allowed to call caesar-encrypt with a sign change for the key (ie negative to positive or positive to negative) within the caesar-decrypt function? This is my interpretation of "Calling it with some key n is exactly equivalent to calling ca...


SVG not supported 12:23am Tue 21st May, ANONYMOUS

Hi Arron, how the test area works, I made mine into 2 files crypto.c main.c , also I provided make file how I can test it now OR that's mean I should change all my work into only one c file ??


SVG not supported 10:37pm Mon 20th May, ANONYMOUS

Hi Arran, In the project spec it says the following We will first implement the Caesar cipher (functions caesar encrypt and caesar decrypt), and then make use of those functions to implement the Vigenere cipher. I want to know whether the caesar encryp...


SVG not supported 5:04pm Mon 20th May, Arran S.

Hi Spencer, The cli function is an important deliverable for the project, and is definitely not "just for" testing You may want to review last week's lecture, since I discussed the cli function and its purpose in a reasonable amount of detail. Als...


SVG not supported 4:53pm Mon 20th May, Arran S.

Hi Spencer, I'll enable the test sandbox shortly. But really, you shouldn't rely on it, and it won't help you much. The project spec and the labs make it clear that part of the work of the project is for students to make use of sanitizers, static anal...


SVG not supported 4:03pm Mon 20th May, Spencer K.

The other two questions still stand, but I just remembered that the user can call the functions and cli is just for testing, please ignore the second question.


SVG not supported 3:59pm Mon 20th May, Spencer K.

Hi I just have a couple questions for the project submission, First, is the project submission section the sandbox we can use? And will we be able to take multiple "attempts" at submitting because it looks like a test format and I want to be sure befo...


SVG not supported 1:23pm Mon 20th May, Arran S.

Hi, If anyone has suggestions for addressing this problem, feel free to post. It's not something I'm able to assist with at the moment, as there is not nearly enough information to go on the name of the signal that caused an error isn't sufficient,...


SVG not supported
project Moodle  👍x1  (all 5)
1:15pm Mon 20th May, Arran S.

Hi, Apologies for the delay. The submission area is available on Moodle. I'll also enable the test area - but bear in mind that it won't substitute for your own testing. cheers Arran ANONYMOUS wrote


SVG not supported 11:55am Mon 20th May, ANONYMOUS

Hey everyone, hope your doing well ) I have a query about this address sanitizer error (AddressSanitizer DEADLYSIGNAL). I keep getting this error in my code, even after I have continuously tested it over and over again. Interestingly, I tried running ...


 UWA week 20 (1st semester, week 11) ↓
SVG not supported
project Moodle  👍x5  (all 5)
5:40pm Sun 19th May, ANONYMOUS

Hi Arran, I hope you're well I'm just enquiring about whether the sandbox and the final submission have been made public yet on the Moodle, because currently I'm not able to view it if it is. Thank you for your help


SVG not supported 1:34pm Tue 14th May, Arran S.

Hi all, The revised project spec is available there are a few minor improvements to wording, but other than that, no very significant changes beyond what's already been flagged in this forum. You can see the exact changes made to the spec document ...


SVG not supported 1:05pm Mon 13th May, Arran S.

Hi ANONYMOUS wrote Well, based on what was said in the lecture, what do you think? What's your interpretation, and if there are bits of the lecture you didn't understand, what exactly were they? Feel free to give timestamps to exact positions in the ...


 UWA week 19 (1st semester, week 10) ↓
SVG not supported 4:26pm Sun 12th May, ANONYMOUS

Hey Arran, I was reading through crypto.h and I saw the preconditions. Is this for us to worry about, or does the caller of the function have to worry about these preconditions? In the lecture slides, it states "should we assert() that the preconditio...


SVG not supported 10:20am Fri 10th May, Arran S.

Hi, A couple of things. The reason you're getting warnings is because the code you're compiling is not, in fact, from the spec. Check the compiler messages carefully You've said you're trying to compile this fragment A char cipher text sizeo...


SVG not supported 6:26pm Thu 9th May, ANONYMOUS

I was trying to run this section of the code from the project outline. This is the code I was trying to run char plain text "HELLOWORLD"; char cipher text sizeof(plain text) 0 ; caesar encrypt('A', 'Z', 3, plain text, cipher text); I compil...


SVG not supported 10:02am Thu 9th May, Arran S.

Hi, It's entirely up to you how you organize your code. What you need to submit is definitions for the 5 required functions (and any helper functions you might define). Anything extra you submit will be ignored, unless it hinders readability or causes...


SVG not supported 7:52pm Wed 8th May, ANONYMOUS

Hi all, Just to check, can we have 2 .c files plus a header, or is it necessary to only use 1 .c file plus a header?


SVG not supported 3:27pm Tue 7th May, Arran S.

Hi, Just to clarify, my suggestion was that you come up with (ideally multiple) ways the apparent contradiction might be resolved the idea here is for students to actively engage with the project specification, and think about how project requirem...


SVG not supported 1:49pm Tue 7th May, ANONYMOUS

Using a simple if statement instead of assert() would be better then.


SVG not supported 1:21pm Tue 7th May, Arran S.

Just "Arran" is fine. I'm going to ask you to reflect a bit more on your question. Can you think of any ways of resolving this possible contradiction? What are they? Suggest some ideas. Cheers Arran


SVG not supported 12:26pm Tue 7th May, ANONYMOUS

Hello Sir, If using assert() to check preconditions, doesn't this go against the project specification where it says never print to standard out or standard error? As I think assert() does print to stderr. Thanks


SVG not supported 10:33am Tue 7th May, Arran S.

Gotcha - the crypto.h version is the correct one (for the reasons I gave - the output parameter comes last). So that's how you need to code your implementation - does that help? Cheers Arran


SVG not supported 9:21am Tue 7th May, Taylah K.

Hi Arran, Apologies, I copied the wrong function in my initial question, In the pdf the caesar decrypt declaration has plain text before cipher text void caesar decrypt(char range low, char range high, int key, const char plain text, char cipher te...


SVG not supported 1:13pm Mon 6th May, Arran S.

Hi, Sure, that sounds mostly right. The code really should be pretty easy, so there should be plenty of time to focus on making sure your code is correct, covers edge cases, and is clear and understandable. Therefore markers will expect a fairly hig...


SVG not supported 12:54pm Mon 6th May, Arran S.

Hi, I'll amend the spec to clarify this the key must fall in the "encryptable range" specified by range low and range high . For each letter of the plaintext which is to be encrypted, we work out an appropriate caesar cipher by subtracting low ra...


SVG not supported 12:48pm Mon 6th May, Arran S.

Hi Taylah, No, that's not a typo. Typically in related functions, we put input and output parameters in a consistent order. In the encryption function, cipher text is an output. But in the decryption function, plain text is the input, and ciphe...


SVG not supported 12:44pm Mon 6th May, Arran S.

Hi Hugo, You're correct, and I've updated the header file. Cheers Arran


SVG not supported 12:43pm Mon 6th May, Arran S.

Hi, As a first step, I'd suggest you show what you think it might look like - presumably you can make some guesses? Cheers Arran


SVG not supported 12:42pm Mon 6th May, Arran S.

Hi, I think you may have a fairly major misunderstanding of the project specification and the header file you're provided with. My first suggestion would be to first make sure you've read through the whole of the specification and the provided heade...


 UWA week 18 (1st semester, week 9) ↓
SVG not supported 4:22pm Sun 5th May, ANONYMOUS

Hi all, Just checking if I understand the project right, so we need to implement encryption and decryption functions for both the Caesar and Vigenere ciphers, following the provided specifications in the crypto.h header file. Additionally, we'll crea...


SVG not supported 1:44pm Sun 5th May, ANONYMOUS

Hey I think I've found another typo. In the pdf the caesar decrypt declaration has plain text before cipher text void caesar decrypt(char range low, char range high, int key, const char plain text, char cipher text); But crypto.h has them the other...


SVG not supported 1:43pm Sun 5th May, Taylah K.

Hey I think I've found another typo. In the pdf the caesar decrypt declaration has plain text before cipher text void caesar encrypt(char range low, char range high, int key, const char plain text, char cipher text); But crypto.h has them the other...


SVG not supported 11:38am Sun 5th May, ANONYMOUS

Hi, Can the key for the Vigenere encrypt and decrypt functions have spaces or punctuation characters in it? Or does it have to be a stream of alphabets? The project spec doesn't mention anything about this..


SVG not supported 2:19pm Sat 4th May, ANONYMOUS

Hi, I don't understand what the function call would look like if we were including punctuation within the range. Would you be able to provide an example of this? Thanks.


SVG not supported 11:42am Sat 4th May, ANONYMOUS

Hi Arran, does this mean we are free to decide whether our function encrypts lower case alphabets and punctuation characters?


SVG not supported 7:30pm Fri 3rd May, Hugo S.

Hi Arran, I found this function declaration in crypto.h void vigenere decrypt(char range low, char range high, int key, const char cipher text, char plain text); can I assume that the key is supposed to be passed as a string instead of an int?...


SVG not supported 2:44pm Fri 3rd May, Arran S.

No worries. Just to explain why it's done this way often, example presentations of e.g. the Caesar cipher will operate only on uppercase alphabetic characters, and everything else is "passed through". But sometimes you might want to treat, say, pu...


SVG not supported 1:43pm Fri 3rd May, ANONYMOUS

Hi again, Yes, sorry for not clarifying, the section that you mentioned is what I was referring to. My understanding is that we should encrypt and decrypt according to those range low and range high values, incorporating wraparound. I have since had a...


SVG not supported 1:37pm Fri 3rd May, Arran S.

Hi, Can you clarify, what part of the spec or code are you referring to, when you say "The project only mentions that the plain text must be between this range"? I can't spot anything in the spec which imposes such a requirement. Amongst other things, ...


SVG not supported 10:54am Fri 3rd May, ANONYMOUS

Hi, Are we able to assume that the given range does not apply to the output of an encrypt function call or do we need to fit the output of the function to match this range? For example, if encrypting from 'A' to 'Z', can the cipher text go outside thes...


SVG not supported 7:37am Fri 3rd May, Arran S.

Hi all, The project spec is now available on the website at https cits3007.github.io assessment project , together with a zipped header file. I've adjusted the due date to 23 May (week 12), as I wanted to allow more than 2 weeks to do it in. Studen...


SVG not supported 2:12pm Tue 30th Apr, Arran S.

Hi Hugo, Apologies for the delay. Yes, the project will be out tomorrow morning - and I'll extend the deadline by a week. (I'll amend the dates on the website shortly.) Cheers Arran


SVG not supported 1:20pm Tue 30th Apr, Hugo S.

Hi Arran, I have two questions about the project - Will it be released this week? - Will it be due on the 16th of May like the unit outline says? Thankyou in advance

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