GitXplorerGitXplorer
C

C.D_Judge

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
6f4d383e5048369adef555220e40c92f97b7add1

v3.1 By Est. Apr 20, 2020

ddark9ive committed 4 years ago
Unverified
9782a9ce24862f44e2929b99b85036b622506994

v3.1 By Est. Apr 20, 2020

ddark9ive committed 4 years ago
Unverified
18b1ba7a72c8fd4062057b904011b9352a7773f1

v3.1 By Est. Apr 20, 2020

ddark9ive committed 4 years ago
Unverified
3427ebb83c5ecb5ee4f7dd279858b48b8c634f57

v3.1 By Est. Apr 20, 2020

ddark9ive committed 4 years ago
Unverified
e0dc583b4176ee120e96c6fd98a90be460630e84

v3.1 By Est. Apr 20, 2020

ddark9ive committed 4 years ago
Unverified
393a073a06155478a938ea191b232c6e566efdf7

v3.1 By Est. Apr 20, 2020

ddark9ive committed 4 years ago

README

The README file for this repository.

C.D_Judge

This is a simple C language judge system.
Only supports on NCCU-ghost(ghost.cs.nccu.edu.tw) currently.
Created by CTHua & Dark9ive.

Get started

Step 1. Clone the project to your own directory using the following command:

git clone https://github.com/CTHua/C.D_Judge.git

Step 2. Change directory into the cloned folder:

cd ./C.D_Judge

Step 3. Compile necessary files:

make

Usage

WARNING:

This project is NOT designed for general user and IS NOT EXPECTING ANY ONE EXCEPT DEVELOPERS TO EXECUTE!!
Running these compiled executable files may CAUSE DAMAGE TO YOUR PERSONAL FILES!!
SO MAKE SURE YOU KNOW WHAT YOU ARE DOING!!
DO EVERYTHING AT YOUR OWN RISK!!

Ganerate encrypted input/output files

You must encrypted your i/o file(s) with following commands:

1keycrypt test_date(YYYYMMDD) num_of_question(s)

Submit answers

Please make sure that you are in the same directory with your "main.c", then type:

/home1/student/stud108/s10829/judge/submit test_date(YYYYMMDD)

Intro

This is a simple judge system. Only supports NCCU-ghost(ghost.cs.nccu.edu.tw) currently.
Planned on making this a website version since we still need more SQL and HTML techniques.

hash.h

hash.h is a C++ source code using crypt(1) and MD5 package from OpenSSL.

This file includes only one function, which can make a hash by giving a char array, then return the hash in another char array.
The Key is generated by the following process:

  1. Get MD5 hash of the input string.
  2. Transform the 128-bit hash result into 16 characters(8 bits per character).
  3. Take the first 8 digits of the transformed characters as the encrypt key.
  4. If there is any null byte (0x00) in the key, change it to 0x01.

1keycrypt

1keycrypt is the C++ compiled executable of crypt.cpp. See further introduce below.

crypt.cpp

crypt.cpp is a C++ source code including hash.h.
The program uses the date to generate a special key, which is used on encrypting test files.

After the key is generated, the script will then encrypt the test data (input) and Answer (output) files using crypt command.

Although crypt(1) is considered not secure enough, we still use it as our encrypt tool because of its convienience. Plus, the key is hard to be brute-forced since there are about 264 combinations in total, and the examinees may only know that the key has something to do with the date. Despite of that, we still planned to add a feature of letting the user to set their own password rather than bind it with the date.

submit

submit is the C++ compiled executable of public_judge. See further introduce below.

public_judge.cpp

public_judge.cpp is a C++ source code including hash.h.

The judge will do these before grading your code:

  1. Make a ".judge" folder under your current directory.
  2. Make a copy of your code into ./.judge and compile it.
  3. Make a copy of your code to admins' folder.
  4. record submit time

And then start the grading process:

  1. If fails to read the compiled executable, gives CE (Compilation Error).
  2. Run the exectable. If runtime stays over 1 second, kill it with signal 9.
  3. If the exit code is 137 (kill signal 9), gives TLE (Time Limit Exceed).
  4. Other non-zero exit code, gives RE (Runtime Error).
  5. Check if the encrypted output file is the same as the encrypted answer, gives AC (Accept).
  6. Otherwise, gives WA (Wrong Answer).

The total score is calculated in the following formula:

For N equals to the total number of AC(s).

Last but not least, clean the trash, show the results and send them to the admins.

Submission status

Please visit our website for current submission status.

Planned feature(s)

  • Custom password for each encryption.
  • Website version(account create, identity verify, db management, etc...)