open is almost working, replaced the sha1 and hmac code