-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Post to 0bin services -- -- Post encrypted content to 0bin sites like http://0bin.net or -- https://paste.ec @package zerobin @version 1.5.1 -- | Various utility functions module Web.ZeroBin.Utils -- | Encodes to base64 and drops padding '='. toWeb :: ByteString -> String -- | Makes a random password makePassword :: Int -> IO String -- | Encryption compatible with SJCL -- --
-- >>> import Web.ZeroBin.SJCL
--
-- >>> import Data.ByteString.Char8
--
-- >>> encrypt "secret-word" (pack "hello")
-- Content {iv = "VxyuJRVtKJqhG2iR/sPjAQ", salt = "AhnDuP1CkTCBlQTHgw", ct = "cqr7/pMRXrcROmcgwA"}
--
module Web.ZeroBin.SJCL
-- | Encrypted content. Each field is a toWeb-encoded byte-string
data Content
Content :: String -> String -> String -> Content
-- | random initialization vector (IV)
[iv] :: Content -> String
-- | random salt
[salt] :: Content -> String
-- | encrypted data
[ct] :: Content -> String
-- | SJCL-compatible encryption function. Follows RFC3610
-- with a 8-bytes tag. Uses 16-bytes cipher key generated from the
-- password and a random salt by PBKDF2-HMAC-SHA256 with 1000
-- iterations.
encrypt :: String -> ByteString -> IO Content
instance GHC.Generics.Selector Web.ZeroBin.SJCL.S1_0_2Content
instance GHC.Generics.Selector Web.ZeroBin.SJCL.S1_0_1Content
instance GHC.Generics.Selector Web.ZeroBin.SJCL.S1_0_0Content
instance GHC.Generics.Constructor Web.ZeroBin.SJCL.C1_0Content
instance GHC.Generics.Datatype Web.ZeroBin.SJCL.D1Content
instance GHC.Show.Show Web.ZeroBin.SJCL.Content
instance GHC.Generics.Generic Web.ZeroBin.SJCL.Content
instance Data.Aeson.Types.Class.ToJSON Web.ZeroBin.SJCL.Content
-- | High-level functions for posting to 0bin services like
-- http://0bin.net or http://paste.ec.
--
-- -- >>> import Web.ZeroBin -- -- >>> import Data.ByteString.Char8 -- -- >>> share "http://0bin.net" Day (pack "hello") -- "http://0bin.net/paste/ZH6VyKXjDHAiPT8J#C6LLidGyHO7xt3xuDtsNHjZ77luualukEuJ25S6w/K1m" --module Web.ZeroBin -- | Expiration of a paste. "Burn after reading" really means "burn after -- two readings", because we do not redirect to the paste like a browser -- does. You can verify your paste before sharing the link. Original -- http://0bin.net does not support Week. data Expiration -- | burn after reading Once :: Expiration -- | keep for 24 hours Day :: Expiration -- | for 7 days Week :: Expiration -- | for 30 days Month :: Expiration -- | for 100 years Never :: Expiration -- | 0bin error message data ZeroBinError ZeroBinError :: String -> ZeroBinError -- | Encrypts the plain data with a random password, post to 0bin and -- return the URI of a new paste. Can throw ZeroBinError or -- HttpException. share :: String -> Expiration -> ByteString -> IO String instance GHC.Generics.Selector Web.ZeroBin.S1_0_2Response instance GHC.Generics.Selector Web.ZeroBin.S1_0_1Response instance GHC.Generics.Selector Web.ZeroBin.S1_0_0Response instance GHC.Generics.Constructor Web.ZeroBin.C1_0Response instance GHC.Generics.Datatype Web.ZeroBin.D1Response instance GHC.Show.Show Web.ZeroBin.ZeroBinError instance GHC.Show.Show Web.ZeroBin.Response instance GHC.Generics.Generic Web.ZeroBin.Response instance Data.Aeson.Types.Class.FromJSON Web.ZeroBin.Response instance GHC.Exception.Exception Web.ZeroBin.ZeroBinError