Device-independent quantum key distribution (DIQKD) provides the strongest form of secure key exchange, using only the input-output statistics of the devices to achieve information-theoretic security. Although the basic security principles of DIQKD are now well-understood, it remains a technical challenge to derive reliable and robust security bounds for advanced DIQKD protocols that go beyond the existing results based on violations of the CHSH inequality. In this Letter, we present a framework based on semi-definite programming that gives reliable lower bounds on the asymptotic secret key rate of any QKD protocol using untrusted devices. In particular, our method can in principle be utilized to find achievable secret key rates for any DIQKD protocol, based on the full input-output probability distribution or any choice of Bell inequality. Our method also extends to other DI cryptographic tasks.