A system for generating a random bit string comprising: a weak source of randomness configured to repeatedly generate a first bit string and a second bit string, the first bit string and the second bit string generated in one instance not necessarily having the same values as the first bit string and the second bit string generated in another instance; a quantum device configured to receive one or more of the second bit strings and, for each of one or more of the second bit strings the quantum device receives, to output an associated third bit string, wherein the quantum device comprises a plurality of quantum systems; a security test device configured to compute a test statistic, for each of such one or more of the second bit strings the quantum device receives, using the second bit string and the associated third bit string; the security test device configured to determine whether to accept or reject the output third bit string of the quantum device based on the computed test statistic, and to determine whether the plurality of quantum systems are approximately non-signaling; a two-source extractor configured to receive, if the security test device accepts the output third bit string of the quantum device, a bit string based on one or more of the first bit strings and a bit string based on one or more of the third bit strings and to generate the random bit string; characterized in that the security test device is further configured to compute: a first test in which a violation of a Bell inequality is measured; and a second test to determine whether the quantum device satisfies a non-signaling criterion; and wherein the second test comprises a determination of whether the plurality of quantum systems are non-signaling or approximately non-signaling; and the security test device is configured to accept the associated third bit string in response to the violation of the Bell inequality and determining that the plurality of quantum systems are non-signaling or approximately non-signaling. a weak source of randomness configured to repeatedly generate a first bit string and a second bit string, the first bit string and the second bit string generated in one instance not necessarily having the same values as the first bit string and the second bit string generated in another instance; a quantum device configured to receive one or more of the second bit strings and, for each of one or more of the second bit strings the quantum device receives, to output an associated third bit string, wherein the quantum device comprises a plurality of quantum systems; a security test device configured to compute a test statistic, for each of such one or more of the second bit strings the quantum device receives, using the second bit string and the associated third bit string; the security test device configured to determine whether to accept or reject the output third bit string of the quantum device based on the computed test statistic, and to determine whether the plurality of quantum systems are approximately non-signaling; a two-source extractor configured to receive, if the security test device accepts the output third bit string of the quantum device, a bit string based on one or more of the first bit strings and a bit string based on one or more of the third bit strings and to generate the random bit string; characterized in that the security test device is further configured to compute: a first test in which a violation of a Bell inequality is measured; and a second test to determine whether the quantum device satisfies a non-signaling criterion; and wherein the second test comprises a determination of whether the plurality of quantum systems are non-signaling or approximately non-signaling; and the security test device is configured to accept the associated third bit string in response to the violation of the Bell inequality and determining that the plurality of quantum systems are non-signaling or approximately non-signaling. a first test in which a violation of a Bell inequality is measured; and a second test to determine whether the quantum device satisfies a non-signaling criterion; and wherein the second test comprises a determination of whether the plurality of quantum systems are non-signaling or approximately non-signaling; and the security test device is configured to accept the associated third bit string in response to the violation of the Bell inequality and determining that the plurality of quantum systems are non-signaling or approximately non-signaling.