Package: polysecrets
PolysecretsA completely randomized order of secrets; built with security in mind. Secrets can be automatically generated
on a time interval or manually generated. Polysecrets keeps the guessing away from the human in exchange for
a truly secret, randomized signing order. Instead of a hardcoded secret that can be stolen during a security
breach, Polysecrets, randomizes the provided string in a way that a secret produced at 8:00pm can be completely
different from a secret produced at 8:01pm, on the same server.Libraries - v0.1.4NodeJS:https://www.npmjs.com/package/polysecretsPython:https://pypi.org/project/polysecrets/AuthorLet's connect on LinkedIn:https://www.linkedin.com/in/jaylen-douglas-292b82a6/RequirementsPython 3.5+Windows, OSX or LinuxInstallLocallygitclonehttps://github.com/ableinc/polysecrets.gitcdpolysecrets

python-mpipinstall--upgrade.orpipinstall--upgrade.PyPi (Pip)python-mpipinstall--upgradepolysecretsor
pipinstall--upgradepolysecretsHow To UsePolysecrets can be used manually or automated. Automated use can be provided a time (in seconds) for
how often a new secret should be generated, the default time is set to 30 seconds. You do not have
to provide a secret to Polysecrets class, but you can if you'd like
certain characters in your secret. Reminder, the secret is a collection of
randomly ordered characters so the secret you provide will not be used entirely.** Look through examples folder **Automated (this will add the secret to your environment)fromosimportenvironfrompolysecretsimportPolySecretsconfig=dict(secret='rAnd0m_s3cr3t',# or use defaultlength=10,# defaultinterval=30,# default (only if you're using automated)uuid='yes',# defaultmixcase=False,# defaultpersist=False,# defaultsymbols=False)automated=PolySecrets(config).automated()# default time is set to 30 secondsprint(environ['secret'])# confirm secret is availableautomated.terminate()# stop automationManual:frompolysecretsimportPolySecretsconfig=dict(secret='rAnd0m_s3cr3t',# or use defaultlength=10,# defaultinterval=30,# default (only if you're using automated)uuid='yes',# defaultmixcase=False,# defaultpersist=False,# defaultsymbols=False)secret=PolySecrets(config).manual()print(secret)# confirm secret is availableRefer to examples folder for all use cases.
Also refer to 'Notes' section at the bottom of
this README.If you want your environment variables cleared after Polysecrets
terminates, do the following:frompolysecretsimportPolySecretsfromosimportenvironconfig={}# use all defaultsautomated=PolySecrets(config=config,clear_on_exit=True).automated()print(environ['secret'])automated.terminate()# forcibly remove envsPersistenceYou can you use the persistence feature to keeps record
of the secrets produced, and verifies that no secret has been duplicated. You will need to have a .env file with the MongoDB credentials inside. An example of the .env file is below:HOST=localhost
#PORT=27017
USER=root
PASS=r00tp@ssw0rD
#DB_NAME=polysecrets
#COLLECTION=secrets
#AUTH_SOURCE=admin

# Host URI Example
HOST=mongodb://user:password@example.com/?authSource=the_database&authMechanism=SCRAM-SHA-1Notes:All variables with the '#' prefix are optional; defaults will be assigned.Host variable can also be a full MongoDB URI. If so, it will ignore all other variables.OptionsYou can do the following with Polysecrets:Manually or Automatically generate new secretsChange time interval for new secret generation (for Automated feature)Change the length of the final Polysecrets secret (refer to Notes at end of README)Choose whether to generate secrets with just UUIDs, Alphanumeric characters or bothPersist generated secrets to ensure the same secret isn't used twiceThe CLI (below) has full details of each option (except automated option)CLIYou can use Polysecrets as a command line tool. CLI does not provided automated feature. If secret is left out, it will default to a random string built into the Polysecrets. An example is below:polysecrets--length20goHelp menuUsage:polysecrets[OPTIONS]GO

Options:-s,--secretTEXTThesecretstring-l,--lengthINTEGERLengthofthesecret.Secrethasaminimumlengthof10-i,--intervalINTEGERHowfrequentlyshouldanewsecretbegenerated(inseconds)-u,--uuidTEXTWhethertouseUUIDsorAlphanumericcharactersforsecretgeneration-yes,no,both-m,--mixcaseBOOLEANDecidewhetherornottomixthecaseofalphacharactersinsecretstring-p,--persistDICTNevergetthesamesecrettwicewithpersistencefromMongoDB--symbolsBOOLEANWhetherornottousespecialcharactersinsecret.Thiswillonlyincreasetheprobabilityofappendingaspecialcharacter.--versionShowtheversionandexit.--helpShowthismessageandexit.BenefitsJSON Web TokensCertificate SigningHashingVarious scenarios of CryptographyWhat's Next(refer to Changelog)If you have found a bug or would like to create new features, make a PR!Changelogv0.1.4- June 1st, 2021Improved CLI toolFixed persistence bugSimplified defaultsv0.1.3- July 11th, 2019Improved code and squashed bugsv0.1.2- July 1st, 2019Persistence added. You can now avoid duplicate secrets being generated.Node version is now available. Install:npminstallpolysecretsImproved code and squashed bugsv0.1.1- June 4th, 2019Custom secret string length, with a minimum of 10 charactersYou may mix the secret, in combination with the provided secret string, with UUIDs, alphanumeric characters or both.You can now select between upper and lower case mixing during secret generationv0.1.0- June 3rd, 2019Manually and autogenerated secrets, with fixed secret lengthPolysecrets CLI addedNoteIf you change the length of the secret via the 'length' parameter, you will notice that the
secret string you provided will not contain all the characters provided. If you want the final
secret to contain all the exact same characters, then provide the exact string length to
Polysecrets 'length' field.The secret provided in the config is just used as reference characters and are not
guaranteed to be a part of the final secret. If you would like to use the secret you
provide I would recommend going the traditional route; add secret to your project
.env file and use Able'sPy.Envspython library.You cannot run manual and automated in the same file. You will throw an error.