• 0 Posts
  • 11 Comments
Joined 3 years ago
cake
Cake day: June 11th, 2023

help-circle

  • Ok I played with this, made a very trivial encoding with 16 words in python for fun today.

    code
    from cryptography.hazmat.primitives import serialization
    from cryptography.hazmat.primitives.asymmetric import ed25519
    import itertools
    import sys
    
    if sys.argv[1] == "words":
        with open("wordlist-65536.txt", "r") as f:
            words = [x.strip().lower() for x in f.readlines()]
    
        assert len(words) == 65536
    
        k = serialization.load_ssh_private_key(open(sys.argv[2], "rb").read(),
                                               password=None)
    
        j = k.private_bytes(encoding=serialization.Encoding.Raw,
                            format=serialization.PrivateFormat.Raw,
                            encryption_algorithm=serialization.NoEncryption())
    
        for a, b in itertools.batched(j, n=2):
            z = a << 8
            if b is not None:
                z = z | b
    
            print(words[z], end=" ")
    
        print()
    
    elif sys.argv[1] == "key":
        seed = [x.strip() for x in input("Enter your mnemonic ssh key: ").split()]
        assert len(seed) == 16
    
        with open("wordlist-65536.txt", "r") as f:
            words = [x.strip().lower() for x in f.readlines()]
    
        assert len(words) == 65536
    
        words_map = {}
        for i, word in enumerate(words):
            words_map[word] = i
    
        k = bytearray()
        for word in seed:
            z = words_map[word]
    
            b = z & 0xff
            a = (z >> 8) & 0xff
    
            k.append(a)
            k.append(b)
    
        k2 = ed25519.Ed25519PrivateKey.from_private_bytes(k)
    
        private_bytes = k2.private_bytes(
            encoding=serialization.Encoding.PEM,
            format=serialization.PrivateFormat.OpenSSH,
            encryption_algorithm=serialization.NoEncryption())
    
        open(sys.argv[2], "wb+").write(private_bytes)
    ```:::
    

  • I self-host almost everything so I am calling “stuff that I don’t control” cloud. This is my ISP and Electric utilities for the most part. Maybe someday I’ll get a 2nd ISP, run BGP with both, then get a generator and eliminate these. For now, my fallback is the actual cloud, if the outage is extended I could somewhat quickly move critical services to rented hosting.

    In regards to email, which I don’t self-host, if my provider suddenly dies I can temporarily or permanently migrate by just changing the mx records.



  • cow@lemmy.worldtoPrivacy@lemmy.ml•What printer?
    link
    fedilink
    English
    arrow-up
    9
    ·
    3 days ago

    Can I jail break my hardware so that I actually own it?

    Maybe, but you probably don’t need to. Why don’t you instead just keep the printer off the internet entirely. Either put it on an air-gapped LAN or connect it to a PC or server with USB.

    Which printer manufacturer is least bad?

    Not sure but some general advice, if you don’t need color get laser. If you do need color get an ink tank printer as it’s physically impossible for the printer to tell what brand of ink you use.

    For privacy, I will warn you that most printers include Machine Identification Code dots on all pages you print that would allow tracking any paper you print back to the specific model and serial number of the machine it was printed on.




  • What’s the security model here? An app that gets user account access but gives it up if it can’t find exactly ssh keys?

    My guess is that a malicious package is scanning your home directory for stuff like SSH keys, GPG keys, AWS keys, etc. It would have filesystem access permission already in the MacOS sandbox due to running inside a common interpreter like node or python, but it might be restricted from stuff like attaching to other processes memory, where it could just get the keys out of bitwarden.

    Could also just be obscurity as most infostealers are programmed to grab keys from common locations and not many developers use bitwarden for keys.

    If you want something resistant to a fully compromised system you need to use something hardware backed, whether an external key or an internal secure enclave.