Jump to content

CPRNG


benanamen

Recommended Posts

I know @Jaques1 has provided an answer somewhere but I couldn't find it. I think it was with mcrypt_create_iv

 

 

 I want to generate a CPRNG to use as an API key. This will also be used as a unique account id (I think).

 

 

Account Usage:

  • An instructor will register a new account and is automatically Super Admin of that account (Account Owner)
  • Account owner can add other instructors to his account who can also optionally be super admins of that account (Sub Instructors).
  • Sub Instructor super admins cannot delete the account owner.
  • Sub Instructor super admins can create other instructors, optionally as super admin or not a super admin

 

Only other user type is a student/examinee. I am thinking there should be one users table and use RBAC,

 

Any suggestions on the table(s) setup or other comments? (This is for an enterprise exam application, my pet project for learning)

 

 

 

 

Edited by benanamen
Link to comment
Share on other sites

I would use the new random_bytes() function. If you don't have PHP 7 yet, you can plug in a compatiblity library for the time being.

 

There's nothing inherently wrong with Mcrypt or OpenSSL, but relying on a single low-level extension can be problematic: None of them is available on all systems, and the Mcrypt extension is actually dying (the original library has been unmaintained for almost 10 years, and the PHP core developers already considered removing ext/mcrypt).

 

The permission model sounds confusing, but you should probably create a separate thread for that.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.