• Deutsch Deutsch German de
  • English English English en
Contact: +49 (89) 413 293 000
sematicon AG
  • News
  • Solutions
    • Solution Overview
    • se.MIS™ Industrial Remote Mangement
    • se.SAM™ Network HSM
      • se.SAM™ N200 Usecases
      • se.SAM™ N200 (Rack)
      • se.SAM™ N200X (Industrial)
    • se.SAM™ Crypto Modules
      • se.SAM™ U Serie (USB)
      • se.SAM™ P-Serie (PCIe)
    • se.SAM™ Embedded
  • Services
  • Support
  • About Us
  • Crypto Corner
  • Contact Us
  • Menu Menu

Calculating the correct lottery numbers “6 out of 49” – 100% correct and 100% secure

  • Share on Facebook
  • Share on Twitter
  • Share on WhatsApp
  • Share on LinkedIn
  • Share by Mail

Calculating the lottery numbers: 100% correct numbers – 100% safe!

Crypto in action: The se.SAM™ N200 Crypto Appliance is suitable for calculating the correct lottery numbers “6 out of 49” – 100% correct numbers and 100% security, for which we offer customers of the appliance a free Python program.

Technical requirements:

  • 1x Linux System with Python 3.7+
  • 1x se.SAM™ N200 Crypto Appliance
  • 6 hours of calculation time for the correct lotto result of the next draw

Now copy the following Python program into a directory on the Linux system and adapt the REST API configuration to the se.SAM™ N200 Crypto Appliance.

#!/usr/bin/python3
import random
import requests as reqs
from requests.auth import HTTPBasicAuth
import json
import urllib3
import sys
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

probability=100
if len(sys.argv) > 1:
    probability = int(sys.argv[1].replace("%",""))

balls=calculation=45  # 6 out of *45* or 6 out of *49*
possible_tips=1
for ball in [6,5,4,3,2,1]: # at 6 out 45 will calculate 8145060 possible tips
    possible_tips=possible_tips*(balls/calculation)
    calculation-=1

tip=[]
calculate_tip=0
hardware=False
loop=True
while loop:
    if hardware:
        data = {'command': 'getrandom', 'numbers': 10000}
        response = reqs.post('https://192.168.178.63/n200/web/postv1',data,
                             auth=('admin','admin'), verify=False)
        if response.status_code == 200:
            results = json.loads(response.text)
            randoms=int(len(results['result'])/2)
            rand=bytes.fromhex(results['result'])
        else:
            print("Error no more random numbers!")
            break
    else:
        randoms=10000
        rand = random.randbytes(randoms)

    for i in range(randoms):
        if rand[i] >= balls*5:  # Correcting the entropy
            continue
        number=(rand[i]%balls)+1
        if number not in tip:
            tip.append(zahl)
        if len(tip) >= 6:
            tip.sort()
            for number in tip:
                print(f"{number} ",end='')
            print()
            calculate_tip+=1
            tip=[]
            if calculate_tip > possible_tips/(probability/100):
                loop=False
                break

The se.SAM™ N200 Crypto Appliance needs about 6 hours to calculate the lottery numbers for the next draw.

How is the caculation done?

When calculating the lotto numbers, the Multi-Source True Random Number Generator of the se.SAM™ N200 Crypto Cores is used to determine the matching six numbers to its maximum entropy. In each determination process, only different groups of numbers are selected and noted in ascending order.

Up to 100% probability!

The result of the calculation can be output via the following command:

$ python3 ./lotto.py 100%

Alternatively, the result can be stored in a lottery result file:

$ python3 ./lotto.py 100% > lottozahlen_vom_01April2022

You can reduce or increase the value 100%. Values below 100% (e.g. 50%) reduce the probability of calculating the correct lottery numbers. Values above 100% (e.g. 150%) increase the calculation effort, but also the probability of correctly determining the lottery numbers.

Checking the lottery numbers!

To check the lottery numbers after the draw, use the following Linux command. Here is an example of the lottery numbers for Wednesday, 1 April 2020:

$ grep “4 15 22 39 46 48“ lottozahlen_vom_01April2020

4 15 22 39 46 48

Redeeming the Lotto winnings

The correct result can be found in the following file with about 100% probability:

$ ls -al lottozahlen_vom_01April2022

-rw-r--r--  1 april april 139M 2022-02-11 15:50 sw3.txt

Note: In order to redeem the determined result in the lottery, you must tap the determined values as a lottery tip. For the 50% probability of the correct tip, about 4 million tips have to be played, for a 100% probability about 8.1 million tips. For 6 out of 49, the probability is about 1 : 15.5 million. Please compare the costs of the tips with the expected lottery winnings.

You can find more information at the following link.

Contact us!

  • Share on Facebook
  • Share on Twitter
  • Share on WhatsApp
  • Share on LinkedIn
  • Share by Mail

Weitere Beiträge

Secure Curves

600% less cryptographic overhead for X.509 certificates

24. August 2022
Read more
https://www.sematicon.com/wp-content/uploads/2022/08/600percent.jpg 542 542 Michael Walser https://www.sematicon.com/wp-content/uploads/2019/03/sematicon.png Michael Walser2022-08-24 14:13:072022-08-29 20:44:37600% less cryptographic overhead for X.509 certificates

IoT PKI – se.SAM™ PKI Mockup

17. August 2022
Read more
https://www.sematicon.com/wp-content/uploads/2022/08/se.SAM-PKI-2.png 542 542 Michael Walser https://www.sematicon.com/wp-content/uploads/2019/03/sematicon.png Michael Walser2022-08-17 17:05:032022-08-29 20:44:38IoT PKI – se.SAM™ PKI Mockup
se.SAM PKI

X.509 Tutorial: 5 ways to issue certificates for IT services, users, clients, and IoT devices

11. August 2022
Read more
https://www.sematicon.com/wp-content/uploads/2022/08/se.SAM-PKI.png 542 542 Michael Walser https://www.sematicon.com/wp-content/uploads/2019/03/sematicon.png Michael Walser2022-08-11 13:50:412022-08-29 20:45:09X.509 Tutorial: 5 ways to issue certificates for IT services, users, clients, and IoT devices
Page 1 of 9123›»

Latest News

  • Secure Curves600% less cryptographic overhead for X.509 certificates24. August 2022 - 14:13
  • IoT PKI – se.SAM™ PKI Mockup17. August 2022 - 17:05
  • se.SAM PKIX.509 Tutorial: 5 ways to issue certificates for IT services, users, clients, and IoT devices11. August 2022 - 13:50
  • Technical Concepts in se.SAM PKI™ for IT, OT, Embedded and IoT30. July 2022 - 14:12
  • The first affordable HSM based IoT Certificate Authority13. July 2022 - 16:53

Categories

  • Crypto Corner
  • Hardware Security Module (HSM)
  • News
  • Partnerships
  • Python Code Examples
  • Videos
  • Corporate Information
  • Data Privacy Notice
  • General Terms and Conditions
Scroll to top

Diese Website verwendet Cookies. Durch die weitere Benutzung der Website erklären Sie sich damit einverstanden.

OKMehr

Cookie and Privacy Settings



How we use cookies

We may request cookies to be set on your device. We use cookies to let us know when you visit our websites, how you interact with us, to enrich your user experience, and to customize your relationship with our website.

Click on the different category headings to find out more. You can also change some of your preferences. Note that blocking some types of cookies may impact your experience on our websites and the services we are able to offer.

Essential Website Cookies

These cookies are strictly necessary to provide you with services available through our website and to use some of its features.

Because these cookies are strictly necessary to deliver the website, refusing them will have impact how our site functions. You always can block or delete cookies by changing your browser settings and force blocking all cookies on this website. But this will always prompt you to accept/refuse cookies when revisiting our site.

We fully respect if you want to refuse cookies but to avoid asking you again and again kindly allow us to store a cookie for that. You are free to opt out any time or opt in for other cookies to get a better experience. If you refuse cookies we will remove all set cookies in our domain.

We provide you with a list of stored cookies on your computer in our domain so you can check what we stored. Due to security reasons we are not able to show or modify cookies from other domains. You can check these in your browser security settings.

Google Analytics Cookies

These cookies collect information that is used either in aggregate form to help us understand how our website is being used or how effective our marketing campaigns are, or to help us customize our website and application for you in order to enhance your experience.

If you do not want that we track your visit to our site you can disable tracking in your browser here:

Other external services

We also use different external services like Google Webfonts, Google Maps, and external Video providers. Since these providers may collect personal data like your IP address we allow you to block them here. Please be aware that this might heavily reduce the functionality and appearance of our site. Changes will take effect once you reload the page.

Google Webfont Settings:

Google Map Settings:

Google reCaptcha Settings:

Vimeo and Youtube video embeds:

Other cookies

The following cookies are also needed - You can choose if you want to allow them:

Privacy Policy

You can read about our cookies and privacy settings in detail on our Privacy Policy Page.

Datenschutzerklärung
Einstellungen akzeptierenVerberge nur die Benachrichtigung