 #
 generateKey = (password, salt) ->
   if password == ''
-    console.error 'Password for key generation empty!'
-    return false
+    throw new Error 'Password for key generation empty!'
 
   hex = sjcl.codec.hex.fromBits
 

#
encryptData = (key, data, adata = '') ->
  if key == ''
    console.error 'Encryption key empty!'
    return false

  options =
    mode : 'gcm'

#
generateSalt = (length = 2) ->
  rand = sjcl.random.randomWords length

  return sjcl.codec.hex.fromBits rand

# Encrypt data with key
