
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
streamlit-rsa-auth-ui
Advanced tools
Encryption on Authenticate widget data from client to server.
Http is the information transfer protocol between networked devices. However, all the requests and responses are in plaintext, which means that anyone can read them.
If you want to deploy streamlit server using http protocol (not https protocol) and you add the user authentication, user password can be read by anyone in the network as it is the plaintext for http protocol.
streamlit-rsa-auth-ui
correct it by encrypting user information including password at the client browser before transmit to streamlit server using RSA algorithm
It is asymmetric cryptography, uses two different but mathematically linked keys
Open a terminal and run:
pip install streamlit-rsa-auth-ui
Create a new file generateKeys.py
from streamlit_rsa_auth_ui import Encryptor
encryptor = Encryptor.generateNew(2048)
encryptor.save('rsa', 'authkey')
Run generateKeys.py
python script
python generateKeys.py
this will create a private key and public key pair
authkey
authkey.pub
āāā rsa
ā āāā authkey
ā ā authkey.pub
Create a new file example.py
import streamlit as st
from streamlit_rsa_auth_ui import Encryptor, authUI, SigninEvent, SigninFormConfig, getEvent
ss = st.session_state
encryptor = Encryptor.load('rsa', 'authkey')
ui = authUI('login_ui_result', encryptor.publicKeyPem)
def checkAuth(username: str, password: str):
return username == 'test' and password == 'New.Prog'
def login():
if 'event' in ss and type(ss.event) is SigninEvent: return True
result = ui.signinForm(default={'remember': True}, configs=SigninFormConfig(remember="Rememeber Me"))
if result is None: return None
_dict = encryptor.decrypt(result)
event = getEvent(_dict)
if type(event) is not SigninEvent or not checkAuth(event.username, event.password): return False
ss['event'] = event
st.rerun()
def logout():
result = ui.signoutForm()
if result is None: return False
_dict = encryptor.decrypt(result)
event = getEvent(_dict)
ss['event'] = event
return True
if not login(): st.stop()
with st.sidebar:
if logout(): st.rerun()
st.title('Streamlit Rsa Auth UI Test')
button = st.button('test')
button
Run the streamlit app
streamlit run example.py
FAQs
Streamlit RSA Authenticator UI
We found that streamlit-rsa-auth-ui demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Ā It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.