(858) 586 7777 | About | Testimonials | Contact
vteams vteams vteams vteams
  • How does it work?
    • Startup Process
    • Your First Day
  • Technologies
    • Hire PHP Developer
    • Hire App Developer
    • Hire JavaScript Developer
    • Hire ROR Developer
    • Hire IOS Developer
    • Hire .NET Developer
    • Hire AI Developer
    • Hire Robotics Engineer
  • Sample Budgets
  • Meet The Team
  • Experiments
  • Captain’s Log
  • Blog
vteams vteams
  • How does it work?
    • Startup Process
    • Your First Day
  • Technologies
    • Hire PHP Developer
    • Hire App Developer
    • Hire JavaScript Developer
    • Hire ROR Developer
    • Hire IOS Developer
    • Hire .NET Developer
    • Hire AI Developer
    • Hire Robotics Engineer
  • Sample Budgets
  • Meet The Team
  • Experiments
  • Captain’s Log
  • Blog
Blog
  1. vteams
  2. Blog
  3. Implementation Of PBKDF1 Data Encryption In Different Languages
Jun 12

Implementation Of PBKDF1 Data Encryption In Different Languages

  • June 12, 2015

PBKDF1 is a password based key derivation function which encrypts data with salt based strategy. It is the part of RSA Laboratories’ Public-Key Cryptography Standards (PKCS) series. On the other hand, PBKDF2 is an improved version of its predecessor PBKDF1 with enhanced functional support and technical upgrading. Many significant changes from PBKDF1 can be identified in PBKDF2 as the new version makes key derivation more sophisticated and accurate. The ability of PBKDF2 to produce keys more than 160 bits long is the most ideal feature that was lacking in the previous version making it a more technologically suave system.

This encryption strategy is used in modern web applications. Now, PBKDF1 has been replaced with its successor PBKDF2 and do not come along with modern SDKs. So, for the sake of backward compatibility in many applications, we implemented the logic of encryption in the following two different languages to compare their output on different platforms:

PHP:

PHP
1
2
3
4
5
6
7
8
9
10
11
12
function pbkdf1_password($password, $salt, $iter){
 
         $pwlen = strlen($password);
    $dlen = $pwlen + 8;
    $buf =  $password . substr($salt,0,8);
    $result = "";
 
    while($iter-- >= 0){
                $buf = sha1($buf,true);
        }
        return $buf;
}

Ruby:

Ruby
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require 'openssl'
 
def pbkdf1(password, salt, iter)
    pwlen = password.size
    dlen = pwlen + 8;
    buf = "#{password}#{salt.slice(0,8)}"
    puts buf.inspect
 
    0.upto iter do
                buf = Digest::SHA1.digest(buf)
                puts buf
    end
 
    buf.each_byte.map{|i| i.ord}
end

 

  • Facebook
  • Twitter
  • Tumblr
  • Pinterest
  • Google+
  • LinkedIn
  • E-Mail

Comments are closed.

SEARCH BLOG

Categories

  • Blog (470)
  • Captain's Log (1)
  • Closure Reports (45)
  • Experiments (7)
  • How-To (55)
  • Implementation Notes (148)
  • Learn More (137)
  • LMS (8)
  • Look Inside (9)
  • Operations Log (12)
  • Programmer Notes (20)
  • R&D (14)
  • Rescue Log (4)
  • Testimonials (25)
  • Uncategorized (4)

RECENT STORIES

  • Top Interview Questions to ask a Data Scientist
  • Kotlin Language – A New Hope for Android Developers
  • 5 Reasons Why JavaScript is the Best For Your MVP
  • React JS – The Undisputed King of Frameworks in Market
  • Top 5 PHP Frameworks in 2021

ARCHIVES

In Short

With the vteams model, you bypass the middleman and hire your own offshore engineers - they work exclusively for you. You pay a reasonable monthly wage and get the job done without hassles, re-negotiations, feature counts or budget overruns.

Goals for 2020

  • Open development center in Australia
  • Complete and Launch the Robot
  • Structural changes to better address Clients' needs

Contact Us

Address: NEXTWERK INC.
6790 Embarcadero Ln, Ste 100,
Carlsbad, CA 92011, USA

Tel: (858) 586 7777
Email: fahad@nextwerk.com
Web: www.vteams.com

© 2020 vteams. All Rights Reserved.

Content Protection by DMCA.com