     
     public func setCipher(cipher: String) {
         self.cipher = cipher;
+    }
+    
+    private func currentTimeMillis() -> Int64 {
+        let nowDouble = NSDate().timeIntervalSince1970
+        return Int64(nowDouble * 1000)
     }
     
     public required init(pubKey : String, subKey : String, secretKey : String, cipher : String, connected : Connected? ) {

    private var init_indexes : [String : [String : [Int : UInt64]]]  = [ : ];
    private var settings : [String : [[String : String]]] = [ : ];
    
    public typealias Connected = (Bool, Magistral) -> Void
    
    convenience init(pubKey : String, subKey : String, secretKey : String, connected : Connected?) {

        
        self.connectionPoints(callback: { [weak self] token, settings in
            self?.settings = settings;
            self?.tokenExp[token] = self?.currentTimeMillis();
            
            self?.initMqtt(token: token) { status, magistral in
                connected?(status, magistral);
