Package: django-secure-password-input
django-secure-password-inputA simple django application provides function to encrypt password value with rsa public key before form submit and decrypt at the backend.Installpipinstalldjango-secure-password-inputUsagepro/settings.pyINSTALLED_APPS=[...'django_secure_password_input',...]DJANGO_SECURE_PASSWORD_INPUT_RSA_PRIVATE_KEY="""-----BEGIN RSA PRIVATE KEY-----......-----END RSA PRIVATE KEY-----"""DJANGO_SECURE_PASSWORD_INPUT_ENCRYPTED_VALUE_PREFIX="rsa-encrypted:"Note:Add your own DJANGO_SECURE_PASSWORD_INPUT_RSA_PRIVATE_KEY and keep it secret. You can generate rsa private key with rsa module in ipython. Copy all things between "BEGIN RSA PRIVATE KEY" and "END RSA PRIVATE KEY" and must include "BEGIN RSA PRIVATE KEY" and "END RSA PRIVATE KEY" lines. It will work if you not provide your own private key, it will use the django_secure_password_input's default private key, and it's not safe for you.In[1]:importrsaIn[2]:pk,sk=rsa.newkeys(4096)In[3]:print(sk.save_pkcs1().decode())-----BEGINRSAPRIVATEKEY-----MIIJNgIBAAKCAgEAnKTiU5t9xdjqp/dktzKBM9w70WFVUO0vZIY/BP8HHZCL13Mo2L5Bld/AV6GbjpRFNLawI8n5rSqXyW+H8Sbh6ZhlPfNkdd4RBIiek6juxBAdkq3QXPs/Kk435zokha+DFfAI3mu3ipLtECNdsIcbYt1FEFY9o+5qMhCTEyBV9aO36hlpNOpQL3rkeT0/a1MFfbb2jFTDdlXmfrRFyqGPufGCfzHwuy5jveedcjt62+Ahdb+vgYux+t5QRVUHcuCFQHk+z6gqgmis3YgII5lQD9XsSGa8pOoSiPaUDHJNikH958Q70OWVPlf7xWkzikGktph2Mtjb0Z0G87P4ZSrl//iLyKf4HQ09QZeV2LpiCeSGJySS4qi2T82s01dqJIg4xNe2Xc+q8uFWzf/KOaELizT8F1+PwA1PZnLOHV4HARsP+yYNJTmV7/cWewulB1a+zov5iZsaE4QCgji8Q1pfPZYab9FQdfTOKpHumLL6KhrV6hutFl/onsB/zkPjL0YeCBYrwTRsex1bk9zOKLYV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Jl7rzJsc9Es20AWN4VNIMC+3lMaN19+mC1KuoKP6A3ihnRMq8lKmg1EkLIQKCARBwpyErdMTWyjlLy82+tF5jODlu/2wz0YakzZHVzWIsshx5yu/xc9CyJ4X/ANWLUBVkD8OgxS60LvR/ShfM6MV8fx499Qnv5wBGcVpIh1S8xos92/dQhIae3r/VPy2T9YJnR1+j4cktd2NT2YRmU5MoLUmVJvvRY8cZ9GjmKfHz3uQuqZ+7cGm2TQZdKhvDLtBesGCel8oG8I5Sf7lJV0G6qlYQWhsoFimY/KITI8M77rcOFbFjN/Q38mvoa1ZevJ8RoLIsnIV5WoRXyyGOzljqePt+JE0GaQtN5YuCLFkOUvbLYrOIu2NhSf2PfF8AshfG9u0HBfdmTKg7tVvR0fhhdjKX3ub/+H8oSvxWpAB+Kw==-----ENDRSAPRIVATEKEY-----In[4]:app/admin.pyfromdjango.contribimportadminfromdjangoimportformsfromdjango_secure_password_input.fieldsimportDjangoSecurePasswordInputfrom.modelsimportAccountclassAccountForm(forms.ModelForm):password=DjangoSecurePasswordInput()classMeta:model=Accountexclude=[]classAccountAdmin(admin.ModelAdmin):form=AccountFormlist_display=["username","password"]admin.site.register(Account,AccountAdmin)Note:Create a form, and override password field using type DjangoSecurePasswordInput.Releasev0.1.0First release. |v0.1.1No depends on django-static-jquery3.v0.1.2Doc update.Add License file.v0.1.3Fix problems in django 3.2.x.v0.1.4Let the end user to choose the package's version.v0.1.5Doc update.