getEntryInfo :: Vault -> IO (Maybe VaultEntry)
getEntryInfo vault = do
    putStr "Enter "
    masterPass <- getMasterPassword
    if verifyMasterPass masterPass vault
        then do
            flushStr "Service: "
            service <- getLine
            flushStr "Username: "
            username <- getLine
            password <- getNewPassword
            flushStr "Tags (separate by whitespace): "
            tagsStr <- getLine
            putStrLn "Note: (control-d to finish)"
            note <- getContents
            passIV <- genNewSalt <$> newStdGen
            noteIV <- genNewSalt <$> newStdGen
            let tags = words tagsStr
                passwordB16 = encryptToB16 masterPass password passIV
                noteB16 = encryptToB16 masterPass note noteIV
                passIVB16 = encodeToStrB16 passIV
                noteIVB16 = encodeToStrB16 noteIV
            return $
                Just $
                VaultEntry
                    service
                    username
                    passwordB16
                    passIVB16
                    noteB16
                    noteIVB16
                    tags
        else do
            putStrLn "Incorrect password!"
            return Nothing
getEntryInfo :: Vault -> IO (Maybe VaultEntry)
getEntryInfo vault = do
    putStr "Enter "
    masterPass <- getMasterPassword
    if verifyMasterPass masterPass vault
        then do
            flushStr "Service: "
            service <- getLine
            flushStr "Username: "
            username <- getLine
            password <- getNewPassword
            flushStr "Tags (separate by whitespace): "
            tagsStr <- getLine
            putStrLn "Note: (control-d to finish)"
            note <- getContents
            passIV <- genNewSalt <$> newStdGen
            noteIV <- genNewSalt <$> newStdGen
            let tags = words tagsStr
                passwordB16 = encryptToB16 masterPass password passIV
                noteB16 = encryptToB16 masterPass note noteIV
                passIVB16 = encodeToStrB16 passIV
                noteIVB16 = encodeToStrB16 noteIV
            return $
                Just $
                VaultEntry
                    service
                    username
                    passwordB16
                    passIVB16
                    noteB16
                    noteIVB16
                    tags
        else do
            putStrLn "Incorrect password!"
            return Nothing
getEntryInfo vault = do
    putStr "Enter "
    masterPass <- getMasterPassword
    if verifyMasterPass masterPass vault
        then do
            flushStr "Service: "
            service <- getLine
            flushStr "Username: "
            username <- getLine
            password <- getNewPassword
            flushStr "Tags (separate by whitespace): "
            tagsStr <- getLine
            putStrLn "Note: (control-d to finish)"
            note <- getContents
            passIV <- genNewSalt <$> newStdGen
            noteIV <- genNewSalt <$> newStdGen
            let tags = words tagsStr
                passwordB16 = encryptToB16 masterPass password passIV
                noteB16 = encryptToB16 masterPass note noteIV
                passIVB16 = encodeToStrB16 passIV
                noteIVB16 = encodeToStrB16 noteIV
            return $
                Just $
                VaultEntry
                    service
                    username
                    passwordB16
                    passIVB16
                    noteB16
                    noteIVB16
                    tags
        else do
            putStrLn "Incorrect password!"
            return Nothing