Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Lumos -> lmohc - close enough ? static id for secure origin #38

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sublimator
Copy link

I mean it's typically going to be pretty obvious when your fans whir up that something is accessing the LLM, but setting OLLAMA_ORIGINS=chrome-extension://* is a bit too loose.

#!/bin/bash -u
# We use set -e and bash with -u to bail on first non zero exit code of any
# processes launched or upon any unbound variable.
# We use set -x to print commands before running them to help with
# debugging.
set -ex

TARGET_ID="lmo*"

while true; do
    # Generate a private key
    openssl genrsa -out private.pem 1024

    # Extract the public key from the private key in DER format and hash it
    ID=$(openssl rsa -in private.pem -pubout -outform DER 2>/dev/null | shasum -a 256 | head -c32 | tr 0-9a-f a-p)

    # Check if the ID starts with the target string
    if [[ $ID == $TARGET_ID* ]]; then
        echo "Match found!"
        echo "Private Key: private.pem"
        echo "Public Key ID: $ID"
        break
    fi

done

@sublimator
Copy link
Author

Related:
ollama/ollama#2335 (comment)

@sublimator sublimator closed this Feb 14, 2024
@andrewnguonly
Copy link
Owner

Sorry, I meant to get to this. I believe it's still valid.

@andrewnguonly andrewnguonly reopened this Feb 14, 2024
@sublimator
Copy link
Author

Do you want to do anything with this?

@andrewnguonly
Copy link
Owner

Do you want to do anything with this?

Yup, sorry. Still thinking through this and some other things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants