THE FORUM IS IN READ-ONLY MODE

This forum is in read-only mode. The new forum is live at https://discourse.openbullet.dev and registrations are open!

code me this.with full source.



  • hello sorry but i am a bit weak at coding,i am giving full source of this,i needed it for many thing.thanks in advance if someone could help

    public static String buildNonce(){
            StringBuffer nonce=new StringBuffer();
            String dateTimeString = Long.toString(new Date().getTime());
            byte[] nonceByte= dateTimeString.getBytes();
            return Base64.encode(nonceByte);
        }
    
    public static String buildPasswordDigest(String userName, String password, String nonce, String dateTime){
        MessageDigest sha1;
        String passwordDigest=null;
        try {
            sha1= MessageDigest.getInstance("SHA-1");
            byte[] hash = MessageDigest.getInstance("SHA-1").digest(password.getBytes("UTF-8"));
            sha1.update(nonce.getBytes("UTF-8"));
            sha1.update(dateTime.getBytes("UTF-8"));
            passwordDigest = new String(Base64.encode(sha1.digest(hash)));
            sha1.reset();
        } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return passwordDigest;
    

    i am also trying by myself for many hours.hope i could get someone to help me!Basically two result comes.
    first one Is Nonce and the last on is passwordDigest



  • whats the questions?



  • you want this in ob or something? cause its not very clear what you are asking



  • okay so i did something in ob i have no way of checking but i just threw this together if it dont work just @ me and ill look at it again

    #gettimes FUNCTION CurrentUnixTime -> VAR "gettimes" 
    
    FUNCTION Base64Encode "<gettimes>000" -> VAR "nonce" 
    
    #sha-1_hashing FUNCTION Hash SHA1 "<PASS><nonce><gettimes>000" -> VAR "hashed" 
    
    FUNCTION Base64Encode "<hashed>" -> VAR "hashbased" 
    


  • @cassell yes bro i wanted for OB.i am checking a bit and i will tell you the result.if doesn't work send work with screesnhot,time and the both nonce,digest at the same time.


Log in to reply