WeBWorK Main Forum

Creating Classlist files - with encrypted passwords

Creating Classlist files - with encrypted passwords

by Gary Hotko -
Number of replies: 2

Good Morning - 

I am new to working with WebWork. We currently use a MS Access Database to create rosters for our classes. From the https://webwork.maa.org/wiki/Classlist_Files#Password_details and the script it indicates that they need to be SHA512 hashed. 

Our desktop computers do not have PERL installed on them and we do not have terminal access to the server to run the PERL scripts there. Are we able to use any SHA512 hashing function (i.e. the Microsoft CNG API -  https://www.experts-exchange.com/articles/37112/Hashing-in-VBA-using-the-Microsoft-NG-Cryptography-CNG-API.html?preview=dBrQ1Gub79o%3D) to create valid passwords for WebWork 2.17?

Thank you. 

In reply to Gary Hotko

Re: Creating Classlist files - with encrypted passwords

by Danny Glin -

Based on the code it appears that the encryption uses the perl crypt function with the SHA512 algorithm.  It looks like 'crypt' does more than just a straight SHA512 hash, so I would expect that using another hashing function wouldn't be compatible.  According to the documentation, crypt in perl is made to mirror they crypt(3) function in C, so if you have an environment where you can use C then you should be able to encrypt passwords in a compatible way from there.

If you leave the crypted_password column blank in your class list file then WeBWorK will use whatever is in the student_id field as the default password.  I realize that this may not be the solution that you are looking for, but it would give you a way to set up passwords without needing access to the crypt function.

In reply to Danny Glin

Re: Creating Classlist files - with encrypted passwords

by Gary Hotko -

Thank you for the feedback. I was able to convince our IT department to install Strawberry PERL on our desktop machines so that we could run the script.