What is the best way to generate a bit-perfect / accurate / secure rip of an audio CD (or DVD) to create a perfect bin/cue file of the disc?

I do not want to encode it (mp3 or flac or...) at this point. Just want to archive the disc perfectly and encode it later.

A command...