GithubHelp home page GithubHelp logo

bdsm's Introduction

BDSM

Bezpieczeństwo Danych Systemów Mobilnych

szyfrować wszystko osobno, każda notatka inny iv4, pbkdf2 albo salt.

https://developer.android.com/guide/topics/security/cryptography#java

  • czyli bouncy castle nie używać Bouncy Castle algorithms The Bouncy Castle implementations of many algorithms are deprecated. This only affects cases where you explicitly request the Bouncy Castle provider, as shown in the following example:

#AES

AES z hasłem użytkownika

SQLCipher

[sqlite> PRAGMA cipher = ‘aes-256-cfb’;] NIE DA SIĘ :< -> brak możliwosci zmiany trybu szyfrowania :< https://discuss.zetetic.net/t/pragma-cipher-command-is-deprecated-please-remove-from-usage/1766/3 jedynie za pomoca : SQLiteDatabaseHook mogę zrobić """database.rawExecSQL("PRAGMA kdf_iter = 64000;");"""

Potenjcalne pytania i odpowiedzi:

Ogólne

  • Poprawna rejestracja (prezentacja)
  • Niepoprawna rejestracja (prezentacja)
  • Przechowywanie haseł w bazie (hashowanie)

Logowanie

  • Logowanie poprawne (prezentacja)
  • Logowanie niepprawne (prezentacja)
  • Porównywanie haseł użytkowniak podczas logowania
  • bcrypt i próba ataku brute force na konto użytkownika
  • Enumeracja użytkowników (czy da się przewidzieć nazwy użytkowników)
  • Token Zabezpieczenia danych/widoku dla notatek tylko dla zalogowanych użytkowników
  • wylogowywanie użytkownika
  • zmiana hasła użytkownika
  • Logi - nigdzie w logach nie przechowuję informacji o hasłach użytkownika; nawet przy niepoprawnym logowaniu
  • SQLI https://en.wikipedia.org/wiki/SQL_injection mam babola w :< Cursor cursor = db.rawQuery("SELECT passwordAES FROM user WHERE username=?", new String[]{username});
  • użyta biblioteka "Bouncy Castle" podobno super extra dla javy

Notatki

  • dodawanie nowej notatki
  • edytowanie istniejacej notatki (wymagane potwierdzenie hasłem użytkownika)
  • usuwanie istniejącej notatki (wymagane potwierdzenie hasłem użytkownika)

Zabezpieczenia

  • dlaczego bcrypt
  • jak zabezpieczony jest widok
  • jak zabezpieczone są operacja CRUD przed niezalogowanym użytkownikiem
  • Czy po zdobyciu praw roota da się odczytać hasła użytkowników
  • szyfrowanie bazy danych https://pl.qwe.wiki/wiki/Database_encryption
  • wymuszanie mocnych haseł na użytkowniku; walidacja hasła
  • dodawanie danych do bazy - nie kleić na chama Stringa - zabezpieczenia przed SQLInjection

Bibliografia: #Praktyka:

PBKDF2 https://gist.github.com/scotttam/874426/e5a0e1317995e9388083eb455c5bb160ec2e1afd

Teoria

Pentesty na kiedyś:

Napotkane problemy

problemy z bcryptem

  • https://www.baeldung.com/java-passwordAES-hashing """5.3. Implementing BCrypt and SCrypt in Java So, it turns out that BCrypt and SCrypt support don't yet ship with Java, though some Java libraries support them. One of those libraries is Spring Security."""

przechowywanie haseł użytkowników

https://nakedsecurity.sophos.com/2013/11/20/serious-security-how-to-store-your-users-passwords-safely/ https://howtodoinjava.com/security/how-to-generate-secure-passwordAES-hash-md5-sha-pbkdf2-bcrypt-examples/ https://crackstation.net/hashing-security.htm https://cryptobook.nakov.com/crypto-libraries-for-developers/java-crypto-libraries

PBKDF2WithHmacSHA256

#Bouncy Castle https://stackoverflow.com/questions/8397557/bouncycastle-on-android You can also try the SpongyCastle library which is a precompiled build of BouncyCastle but tested with Android.

https://github.com/rtyley/spongycastle

Przykład użycia Bouncy Castle

https://stackoverflow.com/questions/22580853/reliable-implementation-of-pbkdf2-hmac-sha256-for-java

Czy to bezpieczne?

https://security.stackexchange.com/questions/179204/using-pbkdf2-for-hash-and-aes-key-generation-implementation

fajne do api na kiedyś

https://medium.com/@rhamedy/encryption-decryption-of-data-based-on-users-passwordAES-using-pbkdf2-aes-algorithms-592f8c1bb79a

tutaj problemy SecureRandom random = SecureRandom.getInstanceStrong(); // wspierana od android 30 o.Ó

próba z tą biblioteką

https://www.mindrot.org/projects/jBCrypt/ https://mvnrepository.com/artifact/org.mindrot/jbcrypt/0.4 https://stackoverflow.com/questions/49530139/how-to-add-the-jbcrypt-library-in-android-studio dodawanie biblioteki https://github.com/advisories/GHSA-gp32-7h29-rpxm

#Toolbar Manifest android:theme="@style/Theme.AppCompat.Light.NoActionBar">

Layout
<androidx.appcompat.widget.Toolbar
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    android:background="@color/colorPrimary"/>
    
 Gradle
    implementation 'com.google.android.material:material:1.1.0'
    
  Java
   import androidx.appcompat.widget.Toolbar;

#Bouncy Castle https://stackoverflow.com/questions/55187472/bouncycastle-connect-to-android-studio implementation 'org.bouncycastle:bcpkix-jdk15on:1.56'

ANDROID onCreateOptionsMenu not called

bdsm's People

Contributors

ktzgraph avatar

Stargazers

狍屬 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.