We prove that as conjectured by Acín et al. [Phys. Rev. A 93, 040102(R) (2016)], two bits of randomness can be certified in a device-independent way from one bit of entanglement using the maximal quantum violation of Gisin's elegant Bell inequality. This suggests a surprising connection between maximal entanglement, complete sets of mutually unbiased bases, and elements of symmetric informationally complete positive operator-valued measures, on one side, and the optimal way of certifying maximal randomness, on the other.