Skip to content
  • Projects
  • Groups
  • Snippets
  • Help

Owo Sugiana / linkaja-crypt

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • linkaja-crypt
  • linkaja
  • crypt
  • payment.py
  • Owo Sugiana's avatar
    Kali pertama · 6333e5ad
    Owo Sugiana committed Mar 11, 2021
    6333e5ad
payment.py 382 Bytes
RawBlameHistoryPermalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
from datetime import datetime
from . import Crypt as BaseCrypt


begin_unix_time = datetime(1970, 1, 1)


def create_iv():
    durasi = datetime.utcnow() - begin_unix_time
    detik = durasi.total_seconds()
    detik = int(detik)
    return str(detik) + '000000'


class Crypt(BaseCrypt):
    def encrypt(self, raw):
        iv = create_iv()
        return super().encrypt(raw, iv)