GithubHelp home page GithubHelp logo

pyshamir's Introduction

Hey 👋, I am Srigovind Nayak

As a software engineer with 3 years of experience, I work on the core backup & recovery features of Zmanda, an enterprise backup and recovery product. I have strong skills in software design, cloud-native development, and delivery. I also foster effective communication and collaboration among the development team, architects, product owners, and business owners. I contribute to some open-source projects and share my technical insights on my blog.

🎖️Certifications

🎯 Focus

  • Research & Development in the Backup and Disaster Recovery domain
  • Software Architecture & Design
  • Cloud-native development, application delivery, and shift-left security
  • Open-source (OSS) development

💪 Technical Skills

  • Cloud Platforms: Azure, AWS, GCP, Cloudflare
  • Cloud-Native: Kubernetes, Helm, Docker, Istio, HashiCorp Vault, GitLab CI, GitHub Actions, ArgoCD
  • Programming: Go, C#, Python, JavaScript
  • Frameworks: .NET Core
  • Database & Cache: SQLite, MS-SQL, MySQL, MongoDB, CosmosDB, Redis
  • Version Control: Git, GitLab, GitHub

🚀 Find me on

linkedin twitter

pyshamir's People

Contributors

abhisheksrikanth avatar hitesh1balegar avatar konidev20 avatar loadingname91 avatar pankul94 avatar sidsbrmnn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pyshamir's Issues

Remove generic type hints to support version < Python-3.9

Hi there

combine and split method in pyshamir have generic type hints list[bytearray], I am running into an error when using this on Python3.8 interpreter:

def combine(parts: list[bytearray]) -> bytearray:
TypeError: 'type' object is not subscriptable

I think this is because the generic type hints were introduced in Python 3.9

I can make the source code change myself but dont want to deviate from upstream. Would you consider removing the type hints to support Python version < 3.9?

Let me know if you are fine with removing them and I can send out a PR for the same. Please let me know if there is a way to go around the issue without making a code change.

Split method generating duplicate shares sometimes

Description of the issue
I need to use this module for sharing a secret key. To ensure the good working of it, I created a test function that generate a random key, split it in shares (3 parts and 2 thresholds), and then combining it back.

For some reason, it appears that sometimes I got the error Duplicate sample when combining the keys. In fact, 2 of my keys are exactly the same.

After a bit of investigating, I found out that it is caused by x_coordinates when generating the shares. If a number is duplicated in the parts firsts values (where parts = 3 in my case), then the shares at index of those duplicates will be the same.

Expected behaviour
Shares are all different
good_behavior

Random bad behaviour
Some shares are exactly the same
bad_behavior

To Reproduce
Steps to reproduce the behaviour:

  1. Go to shamir.py line 77
  2. Replace x_coordinates = [secrets.randbelow(255) for _ in range(1, 256)] with some random numbers, except that there's a duplicate in the 3 firsts one. For example (notice the two 1 at the beginning of the list) :
x_coordinates = [1,1,57,119,170,112,72,53,195,195,131,192,11,101,31,200,190,241,209,89,228,99,82,125,78,208,199,62,225,97,136,19,152,115,66,53,245,214,98,78,165,113,182,159,8,64,223,201,118,117,246,207,22,136,48,50,218,73,107,43,219,83,188,234,104,1,108,206,221,38,183,77,96,138,35,1,213,184,246,241,242,64,239,246,37,206,22,224,159,133,221,64,207,211,24,128,114,227,236,96,42,254,165,64,103,233,143,45,225,97,187,140,98,174,183,209,132,225,233,94,64,180,200,109,190,40,143,153,210,207,220,130,139,75,114,87,45,45,93,111,102,42,247,50,82,208,233,52,67,242,193,218,158,239,22,220,47,136,114,99,244,150,39,198,21,108,64,228,180,214,215,24,248,81,193,215,6,106,84,128,26,196,232,9,247,119,203,64,247,158,16,45,233,108,85,67,94,39,157,64,240,184,129,151,158,117,85,105,254,116,203,252,160,90,56,226,118,105,157,106,239,162,39,50,117,187,187,102,177,101,114,96,250,70,103,26,113,168,2,140,5,151,105,136,129,235,167,75,154,199,204,243,149,156,251]
  1. Run this simple piece of code (you can find it here) :
from base64 import b64decode
import pyshamir

secret = b64decode("a+m4G0kEkKDQK4MFGz7L0vLz5oViQkDSLThiC4zDRZU=")
shares = pyshamir.split(secret, 3, 2)
for share in shares:
    print(share.hex())
  1. As a result, shares 1 and 2 will be exactly the same (as a result of the duplicates 1 in the list), and share 3 will be fine

How to resolve
I think that to solve this problem, the solution is as simple as ensure that the parts first numbers of this x_coordinates are unique. But as I don't know the deep working of this, I don't wanted to make a pull request.

Desktop

  • OS: Ubuntu 22.04
  • Python: 3.10.6
  • Pyshamir: 1.0.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.