'How to apply Shamir's Secret Sharing on strings passwords
I was trying to write a simple code to generate and obtain passwords using Shamir's secret sharing method. My question is:
How can I apply this to string passwords that are not just numbers like 1523?
I have seen a lot of examples of this Shamir's secret sharing method but all of them uses numbers and modules. But if I have a password in string format like password1234, I can't apply this method because of the size of this password in bytes. And I can't use module because I would not be able to recover the original password. Any idea?
Solution 1:[1]
You can convert string -> bytes -> decimal and and get the shares in decimal format. If you combine the shares to recover the original password you sould convert the result vice versa: decimal -> bytes -> string
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Kostas Papageorge |