Text this: An algebraic approach to elliptic and hyperelliptic curve cryptography